| View previous topic :: View next topic |
| Author |
Message |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Tue Oct 20, 2009 2:26 am Post subject: |
|
|
Hi,
| sebarnolds wrote: | | it seems that it always saves my file in ODT format (with the pdf extension). |
It should produce PDF files. Check your code again.
If it still does not work, create a new thread in OpenOffice.org Macros and API, not in OpenOffice.org Code Snippets. And copy/paste your code.
______
Bernard |
|
| Back to top |
|
 |
bitfarmer General User

Joined: 06 May 2004 Posts: 39 Location: Murcia, Spain
|
Posted: Tue Oct 20, 2009 2:50 am Post subject: |
|
|
Hi Ryan, I copy-pasted your savetopdf into my delphi unit that can work with OOo or Word docs transparently (not PDF export in that case, of course!). You are mentioned in the code, BTW.
You can have a look here if interested:
http://www.oooforum.org/forum/viewtopic.phtml?p=344993#344993
NOTE: Actually I managed to convert word docs -or in fact ANY other type of documents windows can print from the right mouse buton- to PDF wihout using OOo, just configuring PDFCreator as default printer and in autosave mode on demmand and then making word to print it out... sounds tricky, but it is VERY tricky, but works OK! |
|
| Back to top |
|
 |
sebarnolds General User

Joined: 19 Oct 2009 Posts: 6
|
Posted: Tue Oct 20, 2009 3:35 am Post subject: |
|
|
I just tested bitfarmer's code and its code has the same behavior on my computer : it produces ODT files (I can rename the PDF in ZIP and open it in 7zip).
Note that I tested with OpenOffice 3.0.0 and 3.1.1
Anyway, if you do not wish that I continue here, I created a new thread here: http://www.oooforum.org/forum/viewtopic.phtml?p=345004#345004
Thank you. |
|
| Back to top |
|
 |
bitfarmer General User

Joined: 06 May 2004 Posts: 39 Location: Murcia, Spain
|
Posted: Thu Oct 22, 2009 12:58 am Post subject: |
|
|
Hi sebarnolds, as I copy-pasted his code, just refactoring some corners, you should get the same result and problems as using Ryan code.
Anyway, I tested my code with this:
TxtDoc:= TDocumentoTexto.create('c:\doc.odt', false);
TxtDoc.SaveToPDF('C:\MyPDF.pdf');
TxtDoc.Free;
And I got a perfect PDF from my odt file, no problems at all (using OOo V3.1.0).
Just a question: Are you trying to convert a ODT to PDF, or is it a HTML or DOC? As commented in the code, if you are converting a HTML, the filter parameter must be canged. ALREADY ANSWERED READING YOUR ORIGINAL POST!
Just for the records: The code above gave a rare error on OOo exit, after the PDF was created, something about MS Visual C++ claming for some "ilegal exit"... just acepted and it was all (adding a sleep(500) didn't help). |
|
| Back to top |
|
 |
myoper General User

Joined: 13 Jun 2011 Posts: 25
|
Posted: Tue Jun 14, 2011 1:19 am Post subject: [Solved] |
|
|
Hi,
I want to Hide the Revision Tracking in the pdf at end of the conversion!
can help me !
Thanks !  |
|
| Back to top |
|
 |
|