flexmark-java icon indicating copy to clipboard operation
flexmark-java copied to clipboard

Request: Exception Handling in PdfConverterExtension

Open Nexxurs opened this issue 6 years ago • 1 comments

Is your feature request related to a problem? Please describe. The following Problem happened to me, when I tried to export a pdf, that already exists and is currently opened by Acrobat Reader.

In the PdfConverterExtension class, Line 102, the possible FileNotFoundException while creating the FileOutputStream is "ignored" and only handled by PrintStacktrace, which makes handling that error impossible.

Describe the solution you'd like Delegate the Exception, although that would break already existing builds. I'm open to suggestions.

Additional context I've found 33 occurrencies of e.printStackTrace(), which probably should be dealt with, one way or another.

Nexxurs avatar Jul 04 '19 11:07 Nexxurs

@Nexxurs, the PDF converter extension is a very thin wrapper around the HtmlToPDF library.

I always recommend to people who want to customize the PDF conversion to just copy the code to their own class and customize it that way. It is much easier than trying to add options to handle the various use cases.

vsch avatar Jul 04 '19 23:07 vsch