[Html2PdfConverter] Unable to Generate PDF Properly

Forge Component
(70)
Published on 2 Jun by Guilherme Pereira
70 votes
Published on 2 Jun by Guilherme Pereira

Hi !


We are trying to generate a sample application with a webscreen below.


But the pdf being generated is like this:


We've already tried different applications with different anonymous screens but we can't generate the expected output of the pdf. We also tried clearing the cache of the browser.


Thank you and hope someone could help me with this.

Can you please share OML and which type of app it is Reactive or Traditional?

Hi! 

[Html2PdfConverter] is not very good in dealing with heavy CSS. Also things that are not visible in the screen  sometimes appear in the pdf, 

To see what you can do to customize the export , please look at the attachment to this message.  

To have a "clean" pdf, I normally use a the screen created specifically to that in a UIFlow with the simplest theme and avoiding the use of any patterns , buttons, links etc. To use a normal screen I use to enclose in a if the elements I don't want to see in the PDF so I can control when they are part of the screen or not. 

Hope this gives you some ideas

Stay safe

Graça 

Maria da Graça Peixoto wrote:

Hi! 

[Html2PdfConverter] is not very good in dealing with heavy CSS. Also things that are not visible in the screen  sometimes appear in the pdf, 

To see what you can do to customize the export , please look at the attachment to this message.  

To have a "clean" pdf, I normally use a the screen created specifically to that in a UIFlow with the simplest theme and avoiding the use of any patterns , buttons, links etc. To use a normal screen I use to enclose in a if the elements I don't want to see in the PDF so I can control when they are part of the screen or not. 

Hope this gives you some ideas

Stay safe

Graça 

Hello,

I was having a similar issue to the OP and it appears that this can't download any of Outsystems external resources like CSS files or images. Do you have any tips on how to get this to work? I tried embedding my CSS via an expression element but it still doesn't render everything the way I wanted it to and the expression shows up as text I don't want visible on the screen.


Hi! 

As I said before [Html2PdfConverter] is not very good in dealing with heavy CSS.

In Traditional web I normally use a UI Flow with a theme Email, and I build a screen specifically for the download , with the simple patterns available. 

As this screen is never used by the user in the browser the complex patterns are normally not useful. 

When a field has to be hidden it's better to use an "If". 

Can not you apply your CSS expression by expression? 


You also have in the forge other hypothesis to transform screens in PDF documents like :

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

This option is more recent and perhaps can solve your problem.


Maria da Graça Peixoto wrote:

You also have in the forge other hypothesis to transform screens in PDF documents like :

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

This option is more recent and perhaps can solve your problem.


Yes, I was originally using this because it worked the way I need it to, but my security team has concerns it's malware because it set off some alerts in some of their scanning software. I went through the code and saw how it works so I don't believe that it does anything malicious but I don't think I'll be able to convince them of that.


So, back to skinny CSS.

Except for images, a lot of the CSS is to handle the interaction with the user, pages to create the PDF do not need it.Some times is easy to create Webblocks with the information that can be exactly equal to be able to build an exact duplicate of the data in the normal screen and the PDF, and replace the input fields and fancy patterns by expressions. 

Kevin VanderWulp wrote:

Yes, I was originally using this because it worked the way I need it to, but my security team has concerns it's malware because it set off some alerts in some of their scanning software. I went through the code and saw how it works so I don't believe that it does anything malicious but I don't think I'll be able to convince them of that.

Hi Kevin. What kind of alerts were triggered?

Leonardo Fernandes wrote:

Kevin VanderWulp wrote:

Yes, I was originally using this because it worked the way I need it to, but my security team has concerns it's malware because it set off some alerts in some of their scanning software. I went through the code and saw how it works so I don't believe that it does anything malicious but I don't think I'll be able to convince them of that.

Hi Kevin. What kind of alerts were triggered?

I don't have exact details but it was something about suspicious activity in some windows temp folders or something along those lines