Hi,
We have a Form in our application, which contains a html_area.
Now we want to print the contents of this HTML_AREA to a PDF document.
If we try it with the controller.showPrintPreview function, what we found in one of the tutorials, we just get a blank pdf file.
Is it possible to print the html_area to pdf? And How?
Thanks.
Joas
October 10, 2011, 12:18pm
2
Janssenjos:
Is it possible to print the html_area to pdf? And How?
Yes, printing HTML_AREA’s is not really different than printing other fields, to do it use code like this:
controller.print(true, false, plugins.pdf_output.getPDFPrinter('c:/temp/out.pdf'));
Make sure that the HTML_AREA is in the body part of your form and that you have one or more records on the form.
Thanks,
But unfortunately it won’t work. Instead of rendered HTML, it just prints it like followed:
Joas
October 10, 2011, 12:34pm
4
Make sure that the html starts with “” and ends with “”.
Ok thanks,
Now the html is rendered, but we have a HTML_Area with a scrollbar.
And only the currently visible part is printed, not the rest.
I suppose there is no solution for this?
Joas
October 10, 2011, 12:47pm
6
Janssenjos:
I suppose there is no solution for this?
Why so negative?
At your HTML_AREA at the printSliding property, allow the height to grow and at your body part check “Allow part to break across page boundaries”.
Thank you very much!
That did the trick.
One question left: I have a footer (with the print button), which i don’t want to display. I can set the printable property on each item to false, but then i still have a white empty part at the bottom of each page. Is there a way to hide the footer in the pdf?
Joas
October 10, 2011, 1:31pm
8
You could remove the footer part using the solutionModel.
But if you only use the footer to show the print button, then I would suggest to not use a footer and show the button in the body.
Ok, didn’t think abuoth that.
Thanks for the help!