[Html2PdfConverter] Encounter CSS Formatting issue when using HTML2PDFConverter
Web icon
Forge component by Miguel 'Kelter' Antunes
Application Type
Traditional Web

Hi, I am using Html2PdfConverter to convert a HTML into PDF. Below was my step

  1. Created a Web Block to generate all the content needed.
    1. Content are table record list generated from SQL widget (statements are executing stored procedure)
    2. Have created some CSS class to format the tables layout
  1. Created a HTML page using Screen and added in the Web Block. This HTML page will be use to generate the content of PDF.
    1. Have created some CSS class to format the layout of the Screen
  1. Created a HTML landing page using Screen for users to generate pdf using Link widget.

Widget Tree


  1. In that landing page, have created a Screen Action to generate PDF using HtmlToPdfConverter logic in Html2PdfConverter extension.

Generate PDF (Flow) : 

  • SetRequestTimeout2 :
    • Action: SetRequestTimeout
    • Timeout: 1800 (seconds)
  • Assign : Set Page Footer html page that we are going to use for the PDF (a URL) and the localorgs for HtmlToPdfConverter settings
    • Page Footer variable: "https://" + GetServerName() + GetOwnerURLPath() + "PageFooter.aspx"
    • Localorgs variable: “"-O Landscape --no-print-media-type --background --footer-font-size 10 --footer-html " + pdfFooter +" --footer-right ""[page] "" " ”
  • HtmlToPdfConventer :
    • OtherArgs = localorgs
    • URL = url of the screen created in step 2.
  • Download :
    • File content = HtmlToPdfConventer.Binary
    • File Name = CurrDate()+"_slides.pdf"
    • Mime-Type = “application/octet-stream”

Flow diagram :

But the exported PDF file not in proper formatting

It should be something like this:

Appreciate that if can help to identify the root cause.


Hi @Roger Jou, we've also encountered the same problem in HTMLtoPDFConverter. In our case, the root cause is the Content-Security Policy of the application is turned on. Please refer to this thread.

We tried all the solution to fix the CSP issue of the extension but with no luck.

As an alternative extension, we use UltimatePDF and so far we are not encountering CSS formatting problem even if the CSP is turned on.

Hope this helps,

Thank you

Hi Marco Mateo, thank you for your prompt replied, it's quite useful to us, I will try to use your suggestion to generate our PDF file.

Hi. Any luck with fixing your PDF issue? We're facing the same issue with our app... Thanks


I am also facing same PDF formatting issue, can anybody help to resolve this.

Thank you 

My PDF formatting issue is resolved, just do following

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



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.