4 ms·
Can we use PDFBox to convert microsoft formats like .doc, .docs, .ppt, .pptx, etc to PDF? I am struggle finding some good solution with the same. Their websit
by techaddict009 11y ago
Can we use PDFBox to convert microsoft formats like .doc, .docs, .ppt, .pptx, etc to PDF?
I am struggle finding some good solution with the same.
Their website doesnt have any proper answer to this.
- voltagex_ 11y agoIt doesn't seem to have that feature, no. Windows 10 and OS X have built in PDF printers now.
- lovelearning 11y agoPDFBox can't do that. Apache OpenOffice API used to be able to do this. Not sure about output quality. Also not sure if LibreOffice API too supports it. You might also want to evaluate a commercial framework like Aspose [1] (not affiliated, I've just come across their marketing pieces) [1]: http://www.aspose.com/docs/display/slidesnet/Converting+Presentation+to+PDF http://www.aspose.com/docs/display/slidesnet/Converting+Pres...
- laumars 11y agoThere's quite a few solutions to do this, from PDF printers (eg CutePDF) through to alternative office suites (eg LibreOffice supports exporting to PDF). However by far the easiest for you might just be to use the Microsoft Office addin that allows you to print to PDF[1] If you need to do this programmatically then you could use the LibreOffice command line tools for converting files[2] [1] https://support.office.com/en-us/article/Print-share-and-protect-files-in-the-PDF-and-XPS-file-formats-f9d35f8f-ca86-4cf9-bb91-4e6d2542eeef?ui=en-US&rs=en-US&ad=US https://support.office.com/en-us/article/Print-share-and-pro... [2] https://ask.libreoffice.org/en/question/2641/convert-to-command-line-parameter/ https://ask.libreoffice.org/en/question/2641/convert-to-comm...
- rodw 11y agoFWIW I just launched a web service API for doing that - https://documentalchemy.com/ https://documentalchemy.com/ If you're comfortable with an external API for this, converting MS Office documents to PDF is as simple as: curl -X POST --form "document=@$SOURCE" -H "Authorization: da.key=$API_KEY" https://documentalchemy.com/api/v1/document/-/rendition/pdf -o "$DEST" You can test it directly online here - https://documentalchemy.com/demo https://documentalchemy.com/demo If you're not comfortable with an external API for this, I think the conventional answer to your question is to use unoconv [1] which is simply a Python script that uses LibreOffice [2] or OpenOffice (formerly StarOffice) [3] to do the conversion. [1] https://github.com/dagwieers/unoconv https://github.com/dagwieers/unoconv [2] https://www.libreoffice.org/ https://www.libreoffice.org/ [3] http://www.openoffice.org/ http://www.openoffice.org/ You can also use Libre/OpenOffice directly for the conversion, but unoconv is geared toward having an always-on version of office running in the background that you use for the conversion, which is a significant performance boost relative to launching the app for every conversion. unoconv is a little flaky, but works well in general (it's certainly a part of the DocumentAlchemy backend).
- volkadav 11y agoIf you needed to stay open source, you could probably wire something up with Apache Poi to handle the msft end of that and pdfbox to handle the pdf end (edit: I mean read the msft file with poi and write out equivalent info using pdfbox into a pdf). It might be ugly, but with enough effort it may work. Where I work, we ended up paying for the commercial Aspose products. Example doc to pdf code: http://www.aspose.com/docs/display/wordsnet/How+to++Convert+a+Document+to+PDF http://www.aspose.com/docs/display/wordsnet/How+to++Convert+...