Converting a page to pdf

A very good morning to all the great programmers in the house. Please, how can I save a page to "pdf" using webview.
I have a site I view using webview and I need to save a page to pdf. Any help please.
Thank you all.

1 Like

Did you try this extension?

1 Like

Using the excellent pdf extension will only convert the visible part of your webview.

You could consider using google apps script?

1 Like

Thank you for your response

If the website you are viewing in the webviewer is mobile friendly, that is, it fits to the width of the webviewer, then it may be possible to do something using Juan's PDF extension.

You can get the full height of the rendered web page and the height of the webviewer window using the runJavascript block, and using division this will then give you the number of "pages" (scroll views). You can then create a loop routine, using the runJavascript block and the addPage block, to scroll the webviewer to each "page", add then page to the pdf, then scroll to the next "page", and so on. It is unlikely this will be accurate, you may have some under/over scrolling depending on the webpage layout / fixed headers. You could reduce the scroll view number / increase the number of "pages" to ensure all the content is displayed, albeit with some duplication top & bottom on each "page"...

Here is an example/demo aia project to get you started...

web2pdf.aia (31.1 KB)

Do things in order:

  • press Load to load the AI2 website
  • press Run to start the conversion routine
  • press View PDF, once the conversion has finished, to view the converted pdf (perversely in a webviewer)

Credits to @Juan_Antonio for the PDf extension (and to me for the ViewPDF extension :wink: )

I am so much grateful to you all.