- Home
- Forum
- ASP.NET Core - EJ 2
- Html-to-PDF converter not waiting till Blazor page is loaded before rendering
Html-to-PDF converter not waiting till Blazor page is loaded before rendering
Apologies if this has been asked previously, but I am wondering if there is a way for the HTML-to-PDF converter tool to wait until a Blazor page has loaded?
We are using this tool to export a page to PDF, but occasionally the page takes a while to load (depends on how much data is being loaded). I can set an 'AdditionalDelay' in the Blink Converter settings, but this doesn't work all the time, and it feels like bad coding to arbitrarily set a time and hope it works.
Is there a way to make the converter wait till the page is loaded before rendering as PDF?
Hi Darryn,
Thank you for getting back to us.
We have checked the reported issue on our end. Upon
further analysis, if the time required to load the resources is unpredictable,
we recommend using the WindowsStatus property in BlinkConverterSettings.
You can modify your HTML file to ensure it meets the value required for the
WindowsStatus property.
Please refer the code snippet below
|
// Initialize the HTML to PDF converter. HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(); BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings(); //Set windows status blinkConverterSettings.WindowStatus = "completed"; //Assign Blink converter settings to HTML converter htmlConverter.ConverterSettings = blinkConverterSettings; //Convert URL to PDF PdfDocument document = htmlConverter.Convert("input.html"); FileStream fileStream = new FileStream("HTML-to-PDF.pdf", FileMode.CreateNew, FileAccess.ReadWrite); //Save and close the PDF document. document.Save(fileStream); document.Close(true); |
However, we have attached our documentation and sample below for your reference
Documentation: Converting HTML to PDF | Syncfusion
Please try the above
sample and let us know the result. If
you are still facing any issue, we kindly request you to share the modified
sample, input HTML document, code snippet, Syncfusion package name and version,
.NET version to reproduce the issue on our end and provide you with a prompt
solution.
Regards,
Arumugam M
Thanks for the reply Arumugam.
I have tried to implement your solution, and it worked for a while, but now it is crashing big time. When I tried to run the converter, it starts a 'Chrome.exe' instance (which I believe is needed to render the PDF), and starts to consume all the memory and CPU.
When I remove the ' blinkConverterSettings.WindowStatus = "completed"; ' setting, and go back to the AdditionalDelay property, it works fine.
I think this may be an issue in the latest versions of the Syncfusion libraries. I had it working in a previous version (29.2.4), but once I upgraded (29.2.11 and 30.x), it caused all sorts of issues.
Hopefully you can help.
Hi Darryn,
Thank you for getting back to us.
We have investigated the reported issue on our end. Upon further analysis, we were unable to reproduce the issue—HTML to PDF conversion is functioning correctly with the WindowsStatus property in Blazor applications when using the latest version of our packages.
We suspect that the issue may be related to the specific input HTML document you are using. To help us analyze this further and provide a prompt resolution, we kindly request you to share the input HTML document and a sample project that reproduces the issue.
For your reference, we have attached the sample along with the corresponding output PDF document.
We encourage you to try the provided sample on your end and let us know the results. If the issue persists, please share the requested details so we can continue our investigation and assist you further.
We look forward to your response.
Regards,
Arumugam M
Attachment: HTMLtoPDFBlazorWindowsStatus_cc90d16.zip
- 3 Replies
- 2 Participants
-
DF Darryn Flood
- Jun 22, 2025 11:33 PM UTC
- Jun 30, 2025 11:45 AM UTC