WestWind.WebView.HtmlToPdf icon indicating copy to clipboard operation
WestWind.WebView.HtmlToPdf copied to clipboard

Loading images before generating PDF

Open quog opened this issue 1 year ago • 0 comments

Hi Rick,

I have a number of powershell scripts that generate monthly reports for my customers by making a HTML file and then converting it to PDF. Previously I have done this via calling msedge.exe or chrome.exe with appropriate command line parameters. However, the latest version of both of those has stopped working for this unless there is no interactive Chrome or Edge running.

Looking for a better solution, I have come across your .net package and have modified your basic consolesample test code to take a file argument. It works when the images are embedded in the .html (e.g for an .svg style image) but for images such as it seems to be intermittent - sometimes the image is present in the pdf and sometimes note. When calling msedge or chrome I used "--run-all-compositor-stages-before-draw" which seemed to fix that.

Is there a setting for the webview2 control that will wait for all images to be loaded before generating the pdf similar to that switch? Or do I need to code the images as data: URLs?

Thanks Damian

quog avatar Sep 02 '24 12:09 quog