320
Views
8
Comments
Solved
How to convert widget Container to PDF?
Question

Hi Folks,
Greetings!

Please see below the screenshot of my tabular sheet design in Container (Outsystems widget)


this sheet is implemented in container so I would like to convert it into pdf.

Because this sheet should be print by printer so for that I need to convert this into pdf. If any other idea you people have to make hard copy of this sheet so kindly share me.

Also please let me know you expect more details from my side.


Thanks
 

Rank: #518
Solution

Hi Folks,

I got the simple way to convert screen to PDF without Htm2PdfConverter component using 


"window.print()"


Only need to create new screen and in Preparation action or any button action invoke RunJavaScript action with only "window.print()" this code.

This way fulfill my requirement. (Y)

Rank: #504

Hi Meer,

Are you working on a reactive web app or a traditional web app?

If it's a traditional web app you can use the html2pdfConverter forge component to create a pdf of your screen.

If it's a reactive web app it'll be a bit trickier since there are no pdf components for it yet but you might try your luck with any of the mobile app components instead.

Kind regards,
Glenn

Rank: #118

Hi Meer,

What you can do is isolate that container and its associated logic in a webblock. That way you can use that block in your current screen but also in a new screen that contains nothing else. This new screen would then be the one you use with the Html2PdfConverter component.

In Mobile I use the PDF Generator Plugin to create PDFs from screens. Perhaps you can also use this? 

Rank: #518
Solution

Hi Folks,

I got the simple way to convert screen to PDF without Htm2PdfConverter component using 


"window.print()"


Only need to create new screen and in Preparation action or any button action invoke RunJavaScript action with only "window.print()" this code.

This way fulfill my requirement. (Y)

Rank: #118

Hi Meer,

Just keep in mind that this approach will require an additional step from your users (the print dialog) and that they have some sort of "print to pdf" printer installed on their machines. Components like Htm2PdfConverter allow your users to simply click a button and immediately download a pdf file.