openoffice.org

How can I count words in complex documents (.rtf, .doc, .odt, etc)?

限于喜欢 提交于 2019-12-04 09:27:59
I'm trying to write a Python function that, given the path to a document file, returns the number of words in that document. This is fairly easy to do with .txt files, and there are tools that allow me to hack support for a few more complex document formats together, but I want a really comprehensive solution. Looking at OpenOffice.org's py-uno scripting interface and list of supported formats, it would seem ideal to load the documents in a headless OOo and call its word-count function. However, I can't find any py-uno tutorials or sample code that go beyond basic document generation, and even

Is it possible to run openoffice macro from external file?

让人想犯罪 __ 提交于 2019-12-04 07:33:37
I want to run OpenOffice macro from external file. Like: vlad@leo ~ $ soffice macro:///home/vlad/q.vbs Not really an answer - just a comment instead, so as to bump this question, and hopefully get an answer :) This possibly has to do with having to explicitly set permissions for macros, for instance: Can't execute macro from command line (View topic) • OpenOffice.org Community Forum Edit: In fact it seems to be impossible to call document macros, which is perfect for security reasons. See also: Custom OpenOffice.org Basic Macros and Libraries - OpenOffice.org Wiki OpenOffice.org Forum ::

Formatted output in OpenOffice/Microsoft Word with Python

人走茶凉 提交于 2019-12-04 06:31:49
I am working on a project (in Python) that needs formatted, editable output. Since the end-user isn't going to be technically proficient, the output needs to be in a word processor editable format. The formatting is complex (bullet points, paragraphs, bold face, etc). Is there a way to generate such a report using Python? I feel like there should be a way to do this using Microsoft Word/OpenOffice templates and Python, but I can't find anything advanced enough to get good formatting. Any suggestions? A little known, and slightly evil fact: If you create an HTML file, and stick a .doc extension

Using pyuno with my existing python installation

爷,独闯天下 提交于 2019-12-03 21:14:17
I'm trying to use PyUNO as a method to convert different document formats (doc, wordperfect, html, etc) to PDF from within my Django server. I'm having a heck of a time getting import uno to work. It seems to fail when doing import pyuno , with a message of ImportError: DLL Load Failed: The specified module could not be found . The only way I can get this to work is to use the Python 2.6 that came with OpenOffice, but I really want to use my other 2.6 installation. The docs for PyUNO are all for Python 2.2, and reputed to be out-of-date. I'm guessing that some (or all) of the following files

How to do a simple mail merge in OpenOffice

大憨熊 提交于 2019-12-03 17:31:07
I need to do a simple mail merge in OpenOffice using C++, VBScript, VB.Net or C# via OLE or native API. Are there any good examples available? I haven't come up with a solution I'm really happy with but here are some notes: Q. What is the OO API for mail merge? A. http://api.openoffice.org/docs/common/ref/com/sun/star/text/MailMerge.html Q. What support groups? A. http://user.services.openoffice.org/en/forum/viewforum.php?f=20 Q. Sample code? A. http://user.services.openoffice.org/en/forum/viewtopic.php?f=20&t=946&p=3778&hilit=mail+merge#p3778 http://user.services.openoffice.org/en/forum

C#: Getting the number of rows/columns with ExcelPackage

♀尐吖头ヾ 提交于 2019-12-03 10:23:25
I need to read and write data from an Excel spreadsheet. Is there a method to finding out how many rows/columns a certain worksheet has using ExcelPackage? I have the following code: FileInfo newFile = new FileInfo(@"C:\example.xlsx"); using (ExcelPackage xlPackage = new ExcelPackage(newFile)) { ExcelWorksheet worksheet = xlPackage.Workbook.Worksheets[1]; } I need to iterate through each cell this worksheet has and spit it into a fairly big table, but I don't want to print out blank cells or get an exception. Is there a method resembling worksheet.rowNum or colNum ? You can get the row and

Lighweight markup (wiki) language for documenting

删除回忆录丶 提交于 2019-12-03 09:36:21
问题 When I write papers or documentation it makes think using LaTeX or OpenOffice is overkill as I usually only need some markup elements (bold, headlines, lists, ...) . I'd like to write my documents using a wiki style markup as this is very efficient. For example: = Introduction = '''HTML''' is a markup language... In the end I'd like to simply convert it to PDF. (Cross-platform was nice too.) compiler.exe -pdf input.wiki output.pdf Is there a tool (or simple tool chain) to do this job? I'd

Mailmerge using OpenOffice

做~自己de王妃 提交于 2019-12-03 08:45:44
I'm currently trying to do a mailmerge, using C# and OpenOffice. I have a list of destanatary in my DB. I would like this to be possible : the user edit an OO document, put fields like "name" "adresse" "city" and some standard text (e.g. : "Hello Name how are you ?", edit the style, etc etc, then go to my application, clic on "Send to all user in DB". Then the program loops through all user, and for each user replace the mailmerge fields in the OO document with DB data's, send it by mail/print/whatever. Problem : I can't find any way, in C#, to replace the mailmerge fields in the OO document

Create openoffice .odt document with Python

帅比萌擦擦* 提交于 2019-12-03 07:45:55
How can I create an open office .odt file from Python? I'm looking at this http://wiki.openoffice.org/wiki/Python , but am confused. I've already got Python 2.7 so where do I go from here? The above link talks about Open Office shipping with Python. Have I already got it?? And do I even need OpenOffice? Isn't there just some template, some way that a document needs to look like so it will will recognized as odt? Would I need the actual editor? I'd like something like https://github.com/mikemaccana/python-docx , but for Open Office. Sorry for this open ended question, but I really have looked

Merging two .odt files from code

江枫思渺然 提交于 2019-12-03 05:59:12
How do you merge two .odt files? Doing that by hand, opening each file and copying the content would work, but is unfeasable. I have tried odttoolkit Simple API (simple-odf-0.8.1-incubating) to achieve that task, creating an empty TextDocument and merging everything into it: private File masterFile = new File(...); ... TextDocument t = TextDocument.newTextDocument(); t.save(masterFile); ... for(File f : filesToMerge){ joinOdt(f); } ... void joinOdt(File joinee){ TextDocument master = (TextDocument) TextDocument.loadDocument(masterFile); TextDocument slave = (TextDocument) TextDocument