Converting .docx files to pdf programatically

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
srimovila
Posts: 1
Joined: Wed Aug 14, 2013 6:39 pm

Converting .docx files to pdf programatically

Post by srimovila »

I would like to use OpenOffice api to convert .docx files to pdf format using Java. I don't want to force the users of my application to install OpenOffice. So, I am looking at embedding OpenOffice components in my application itself. Looking for guidance on how to achieve this.

Thanks in advance for your help.

Best Regards,
Sai
User avatar
Zizi64
Volunteer
Posts: 11360
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Converting .docx files to pdf programatically

Post by Zizi64 »

So, I am looking at embedding OpenOffice components in my application itself.
Do you mean: you want use the "PDF export" function of the Apache OpenOffice/LibreOffice?
You can use a lot of freeware "virtual PDF printers" or other PDF converter softwares for this task.
But you can not use the built in Open/LibreOffice functions without install one of the open source office suites.

(Otherwise you can download the source codes of the Apache Openoffice, or LibreOffice, and you can get code snippets from them - if you are familiar, and expert to programming...)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Converting .docx files to pdf programatically

Post by Villeroy »

Open/LibreOffice is not good at reading OOXML files.
Better download the free readers for Word/Excel/PowerPoint from MS and print your documents to a virtual PDF printer.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply