Page 1 of 1

Document Closed before post Processor on PDF Exporter.

Posted: 17 Jul 2017, 16:09
by digopim
Since v 6.1 we can not add elements (like sign's bar and images) to a pdf document generated by the exporter, cause the document is closed before the call for postProcessor method (PDFExporter.class l.141 ~ l.145).
That's any chance to make it like previous version 6.0 when the document.close() was called after postProcessor methods ... ?

Re: Document Closed before post Processor on PDF Exporter.

Posted: 17 Jul 2017, 20:13
by Melloware
Please report the issue on our Github...

https://github.com/primefaces-extension ... com/issues

Do you think it was related to this fix?

https://github.com/primefaces-extension ... issues/433

or could it possibly be something PF fixed in core PF?

Re: Document Closed before post Processor on PDF Exporter.

Posted: 17 Jul 2017, 21:23
by digopim
I reported the Issue on git Hub like u asked.
https://github.com/primefaces-extension ... issues/468

Cause it was only a problem on PDF exporter I did not think that are any relation with the Issue 433 (xlsx Exporter Problem)
and if was un fix on PF core, i really do not get it. Why blocking adding elements after data content could be a problem.

See the code :

On 6.0

Code: Select all

if (postProcessor != null) {postProcessor.invoke(context.getELContext(), new Object[] { document });}} document.close(); writePDFToResponse(context.getExternalContext(), baos, filename);
On 6.1.1

Code: Select all

document.close(); if (postProcessor != null) {postProcessor.invoke(context.getELContext(), new Object[] { document });} writePDFToResponse(context.getExternalContext(), baos, filename);
The document is closed anyway.

Re: Document Closed before post Processor on PDF Exporter.

Posted: 17 Jul 2017, 21:59
by Melloware
I just committed a fix if you would like to review it.