radkovo / Pdf2Dom

Pdf2Dom is a PDF parser that converts the documents to a HTML DOM representation. The obtained DOM tree may be then serialized to a HTML file or further processed. A command-line utility for converting the PDF documents to HTML is included in the distribution package. Pdf2Dom may be also used as an independent Java library with a standard DOM interface for your DOM-based applications or as an alternative parser for the CSSBox rendering engine in order to add the PDF processing capability to CSSBox. Pdf2Dom is based on the Apache PDFBox™ library.
http://cssbox.sourceforge.net/pdf2dom/
GNU Lesser General Public License v3.0
175 stars 71 forks source link

printStackTrace() in FontTable #22

Closed fisch92 closed 6 years ago

fisch92 commented 6 years ago

In class FontTable on line 200, there is a ex.printStackTrace();

It would be really nice to remove this and throw an Exception, so the user of your library can decied if he want to see the stacktrace or not.

m-abboud commented 6 years ago

My qualm with throwing an exception there is causing the whole PDF conversion to halt because of just one font which won't really ruin the final output without it seems like a bad idea. And the font library we're using isn't the most stable.

Seems like it should just be doing the error log message there and the printStackTrace is extraneous and I forgot to remove it. Would just removing the printStackTrace work for you?

fisch92 commented 6 years ago

Yes, this would work for me. Tank you!

m-abboud commented 6 years ago

Fixed this and other ones in above pull request