[Html2PdfConverter] Empty page returned by Generate PDF

Forge Component
(68)
Published on 5 Feb (3 weeks ago) by Miguel 'Kelter' Antunes
68 votes
Published on 5 Feb (3 weeks ago) by Miguel 'Kelter' Antunes

Hi HTML2PDF Team!

So first of all thank you very much for developing and maintaining this component, it has helped me in a lot of projects. 

I'm running into a problem and I was wondering if you could help me shine some light on the issue. The application is installed in the client’s environment and the sample pages are working correctly. However, at the moment I am choosing one of our applications I'm getting an empty/white screen. Even when I build a very empty "HelloWorld" screen it doesn’t show the text, please see the screenshots.

What could be the cause of this behaviour?

Kind regards,
Martijn Habraken

Hi Martijn,


If the sample pages are working it should be well configured. It could be some kind of network prob or redirection or some code issue. Have you tried to access the exact same url from an anonymous/incognito browser? Can you try it in the OS platform server if you have access? The things to troubleshoot would be hostname resolving from the platform server.


Otherwise can you share the hello world module and the one you’re using to generate the pdf so we can take a look?


Thanks,

Guilherme

Hi Guilherme,

I just moved the HelloWorld Web Screen to another UI Flow that uses a different theme (an empty theme). This solved the problem and now I'm seeing the text 'Hello World', so it seems that the CSS of the other theme is somehow conflicting with the HTML2PDF converter. 

Are there CSS classes we can't use in this component?

Kind regards,
Martijn Habraken

Solution

Hi Martijn,


I'm not aware of any incompatibilities with CSS but it's always possible that they exist. I do know of an incompatibility with some JS from SILK do detect mobile devices that in some cases would cause the page to render improperly and is something I mention in the FAQ. 


The workaround is the one you're using, Empty theme and create the CSS from scratch.


In order to try and detect that what you could to is try and run wkhtmltopdf from your computer using windows command line and if I recall correctly you'd get an error on the console about javascript.


Cheers,

Guilherme

Solution

Hi Guilherme,

Just to give you an update. I think it has something to that we use flex positioning in our CSS.
We are going to create a new CSS file and pages for these exports.

Kind regards,
Martijn Habraken