Facing Generate PDF formatting UI issue in using HtmlToPdfConverter
Application Type
Traditional Web

PDF Formatting issue in Transitional application.
I have used HtmlToPdfConverter to generate pdf

Working PDF format is like below


Issue in PDF now is


There is no change in code.

Can anybody suggest how this can resolved.

Solution

I changed style-src to the following in Lifetime, Environment Security, CSP:

*

Self

Then I republished all modules (took several hours), and finally it is working as expected.

Dear Meer,
Greetings of the day

Can you please provide more details of this issue which you are facing ?
- like if you have updated the version of this component recently ?
- Since when you are facing this issue ? This is for all users or only specific users ?

Also I would recommend to post this question / issue in plugin support it self. So that plugin developer/community  team will be immediately notified for this and your support can be expedite.


Regards,
Palak Patel

Hi! 

Like Palak said , it is difficult to figure out what is happening to you, but one thing I recommend is to put the screen used to create the PDF in a flow with a very, very simple theme, heavy themes and HtmlToPdfConverter are not a good  idea. Normally I use the "Email" theme , it has only the basics but is enough to build a report. 

stay safe 

Graça

Thanks for reply Palak Patel and Maria da Graça Peixoto .

Actually there is no changed in plugin and nothing, and it was working till end of February 2022.

Second screenshot is plain pdf actual one and first screenshot is expected.

Code flow: I am passing html and css value to binary content of HtmlToPdfConverter





Have you found any error in the platform logs? 

It seams it cannot build the table and is issuing each line as a normal paragraph



This is error message that I have got from log. 

I would try to solve that problem first. That's an error in a Advanced Query (SQL), it has nothing to do with the "HtmlToPdfConverter " but can interfere with execution. 

Probably TO_CHAAR is not an oracle function.

Let me check and will get back to you

I have replaced to_chaar and error is not coming now. And logo is displaying in PDF, please see below yellow marked. But still the issue for formatting PDF is there.


Hi @Meer Imtiyaz  you can use this  forge links for your issue I am also facing the same issue now I am using these its working fine:

https://www.outsystems.com/forge/component-overview/7918/open-html-to-pdf

Thank you Naveen kumarasamy, can you please give me steps to use this component so that I can easily implement.

Hi @Meer Imtiyaz 

Steps to use these components:

1.Download Open html to PDF pulg-in from forge

2.Open the downloaded file

3.you use the  server action  in your flow PFA for your reference

Capture.PNG

Thank you for provided such steps. I will implement to check this component also.

Naaveen, I have to fetch data from multiple Entities in HTML code itself pass  url (to get data) to HtmlToPdfConverter in input parameter URl so internally it fetch data and make HTML code and then it passes to GeneratePDF action to generate pdf.

And in open-html-to-pdf  plugin need to pass complete html string with all data. And I am not able to pass complete html with required data to generate pdf, is there any way to fetch data from url and generate html string with data?

I have used and pass my own html string to it and it generating pdf with formatting.

I have been working on it still and am trying to achieve what I want from open-html-to-pdf  plugin, you can also suggest the same way what I expect.

Thank you Naveen kumarasamy 


Hi Meer! 

I'm stuck. 

Like I had noted above, it  seems the HTML tags from the table are not being recognized.

Try use less data (20 pages is a little bit difficult to analyze ) and verify if some character  looks strange.
Sorry

Graça

Maria da Graça Peixoto, this has been reproduced for single page too.

Dear Meer,
Greetings

Are you still able to see any errors in service center ?

Please also note that I can see there is list structure being rendered in your PDF.
So the issue might be purely designing and how HTML tables/elements are being rendered in the PDFs.

Please note that some of the CSS or inline styles don't work in these PDF renderers.

Can you double check that ? 


Regards,

Palak Patel

ok Palak Patel , I will check it and let you know.

No error found in Service center.

It was working for multiple pages. (and now facing PDF formatting issue even there is no code changed)

Also checked CSS, there are simple CSS applied. At least few of them CSS should work if there is issue with some of CSS, right?


Dear Meer,
Greetings of the day

Knowing that its formatting issue, I am not sure how to reproduce and check this thing with you.

I would suggest to drop a very simple oml having this issue only in single page html/pdf. So that we can at least understand the issue.

Else you can open same thread in Plugin Support it self. So development team of plugins can better help you and your issue can be quickly solved.

Regards,

Palak Patel



You are right Palak Patel , I will create ticket with Plugin team. thanks for suggestion. 

It is very difficult to create oml for this because I have multiple steps with multiple modules to do this. Even I will try to make oml if success then I will shared here. 

Thank you

Hi, 

I have applied "*" to img_src and style_src as per following post saying to changed


But still facing same issue.

If you guys know about this so please let me know.


Thank you


Solution

I changed style-src to the following in Lifetime, Environment Security, CSP:

*

Self

Then I republished all modules (took several hours), and finally it is working as expected.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.