How to download a part of the page as a PDF file?

I have an HTML page, how to extract one of the divs and download it as a PDF file?



kong dejing wrote:

How to download a part of the page as a PDF file?

I have an HTML page, how to extract one of the divs and download it as a PDF file?



Hi,

Could you specify if you're working on a traditional web app or a reactive web app?

Kind regards,
Glenn


You need to make the page "public", and then you can use  forge components like HTMLToPDFConverter.

Or run script "print_current_page()"  to use the "Print" functionality from the browser.

glenn michiels wrote:

kong dejing wrote:

How to download a part of the page as a PDF file?

I have an HTML page, how to extract one of the divs and download it as a PDF file?



Hi,

Could you specify if you're working on a traditional web app or a reactive web app?

Kind regards,
Glenn


a traditional web app


Nikolai Kaplin wrote:

You need to make the page "public", and then you can use  forge components like HTMLToPDFConverter.

Or run script "print_current_page()"  to use the "Print" functionality from the browser.

Thank you very much for your reply. But it doesn't solve my problem.


kong dejing wrote:

glenn michiels wrote:

kong dejing wrote:

How to download a part of the page as a PDF file?

I have an HTML page, how to extract one of the divs and download it as a PDF file?



Hi,

Could you specify if you're working on a traditional web app or a reactive web app?

Kind regards,
Glenn


a traditional web app


For traditional web apps you should use one of the forge components.

https://www.outsystems.com/forge/component-overview/209/html2pdfconverter

Or

https://www.outsystems.com/forge/component-overview/5641/ultimate-pdf

Would be able to do what you require.

Kind regards,
Glenn


Hi Kong,

Why not create the part of the page that interests you in a new screen in anonymous mode.
So whenever you want to download pdf you just have to convert these anonymous screen to pdf using HTMLTOPDF.


I hope it helps :)



kong dejing wrote:

Nikolai Kaplin wrote:

You need to make the page "public", and then you can use  forge components like HTMLToPDFConverter.

Or run script "print_current_page()"  to use the "Print" functionality from the browser.

Thank you very much for your reply. But it doesn't solve my problem.



If you want download only a part, you can create empty page with nessesary content.
Or buid extension ( create  pdf from one part of the page ).

Nikolai Kaplin wrote:

You need to make the page "public", and then you can use  forge components like HTMLToPDFConverter.

Or run script "print_current_page()"  to use the "Print" functionality from the browser.

How do I use this script?


Rodrigo Lima wrote:

Nikolai Kaplin wrote:

You need to make the page "public", and then you can use  forge components like HTMLToPDFConverter.

Or run script "print_current_page()"  to use the "Print" functionality from the browser.

How do I use this script?



It is the same as you press ctrl+p. Run script and you can see such modal