Emerjoin / Hi-Framework-features

Java EE Framework
5 stars 1 forks source link

Paradoxal reporting - the propostal (with wkhtmltopdf) #108

Closed emjunior258 closed 7 years ago

emjunior258 commented 7 years ago

A request is sent to a controller/action with a special HTTP header: p-print.

The p-print header has two possible values: CSV, XLS and PDF.

PDF

When the user says he wants to print the view has PDF, his cookie is collected and the controller/action path is also collected.

These two parameters are then used to invoke the HtmlToPdf web-service which will invoke the wkhtmltopdf command and will pass the collected path and the collected cookie as arguments. Its also passed as argument a script to be executed when the page is ready. The script is responsible for hinding elements that arent supposed to be part of the printed document. When the printed document is generated. The web-service returns its path and then the web-app

a) Outputs it with the respective header - when the request is not via frontier (ajax)

b) Returns the download path - when the request is via frontier