OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Delphi and OOWriter ExportToPDF
Goto page Previous  1, 2
 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Code Snippets
View previous topic :: View next topic  
Author Message
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1453
Location: France

PostPosted: Tue Oct 20, 2009 2:26 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
bitfarmer
General User
General User


Joined: 06 May 2004
Posts: 39
Location: Murcia, Spain

PostPosted: Tue Oct 20, 2009 2:50 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sebarnolds
General User
General User


Joined: 19 Oct 2009
Posts: 6

PostPosted: Tue Oct 20, 2009 3:35 am    Post subject: Reply with quote

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
View user's profile Send private message
bitfarmer
General User
General User


Joined: 06 May 2004
Posts: 39
Location: Murcia, Spain

PostPosted: Thu Oct 22, 2009 12:58 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
myoper
General User
General User


Joined: 13 Jun 2011
Posts: 25

PostPosted: Tue Jun 14, 2011 1:19 am    Post subject: [Solved] Reply with quote

Hi,
I want to Hide the Revision Tracking in the pdf at end of the conversion!
can help me !
Thanks ! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Code Snippets All times are GMT - 8 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group