ProcessMaker provides an option to show a print button on DynaForms, which will generate a PDF similar to an Output Document.
printFormProperty.png (27.14 KiB) Viewed 12538 times
It appears in the upper right hand corner of the DynaForm:
PrintUpperCorner.png (12.51 KiB) Viewed 12538 times
If clicked, then it opens a print dialog box for your operating system:
PrintIconUpperRightCorner.png (28.78 KiB) Viewed 12536 times
But it creates a PDF file without formatting:
PDFGeneratedFromScreen.png (18.5 KiB) Viewed 12538 times
If you want to automatically open the print dialog box when the DynaForm is submitted, then add this JavaScript code to your DynaForm:
Code: Select allvar printed = false;
getFormById( $("form").prop("id") ).setOnSubmit( function() {
if (printed == false) {
$("a.print-button").click();
printed = true;
return false;
}
});
The problem is if you want the PDF to have the same style as your DynaForm. You can use an outside library like
html2canvas, that creates a screenshot based on the DOM. I haven't tried it, so I don't know if it will render all the CSS correctly. There are also many plugins to take screenshots of web browsers. For example:
http://designwebkit.com/web-design/fire ... re-addons/
There is no way (that I know) to use JavaScript with these plugins to take a screenshot of your DynaForm, so you have to rely on the user to do it manually.