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
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