News for hackers. Stuff that matters.
Re:Apache PDFBox – A Java PDF Library by techaddict009 on Monday March 21, 2016 @10:23AM (#11328213)
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.

Re:Apache PDFBox – A Java PDF Library by rodw on Monday March 21, 2016 @11:03AM (#11328514)
FWIW I just launched a web service API for doing that - 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

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

[2] https://www.libreoffice.org/

[3] 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).

Re:Apache PDFBox – A Java PDF Library by laumars on Monday March 21, 2016 @10:43AM (#11328377)
There'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-pro...

[2] https://ask.libreoffice.org/en/question/2641/convert-to-comm...

Re:Apache PDFBox – A Java PDF Library by volkadav on Monday March 21, 2016 @11:03AM (#11328520)
If 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+...

Re:Apache PDFBox – A Java PDF Library by lovelearning on Monday March 21, 2016 @10:42AM (#11328368)
PDFBox 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+Pres...

Re:Apache PDFBox – A Java PDF Library by voltagex_ on Monday March 21, 2016 @10:26AM (#11328233)
It doesn't seem to have that feature, no.

Windows 10 and OS X have built in PDF printers now.

Re:Apache PDFBox – A Java PDF Library by PinguTS on Monday March 21, 2016 @10:46AM (#11328404)
Is the Windows 10 PDF printer better than the MS Office integration?

Because the MS Office PDF integration is shit, when I get such PDFs in Preview on Mac OS X and then want to print it.

Re:Apache PDFBox – A Java PDF Library by nova22033 on Monday March 21, 2016 @10:41AM (#11328357)
What if I need to do this programmatically?