Html to PDF generation -Blazor Server app - Apple M4 - Syncfusion.Pdf.PdfException - Blink files are missing
Hi,
Environment: Apple m4 macair, .Net 9.0, Rider IDE, Syncfusion Blazor components v29.1.41
I am getting the following exception when attempting to run code that converts html to PDF using Syncfusion libs.
Syncfusion.Pdf.PdfException: Blink files are missing at /Users/sathyar/Webdev/HmsBlazorServer.App/bin/Debug/net9.0/runtimes/osx/native
My code is as follows -
//Initialize HTML to PDF converter with Blink rendering engine
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set command line arguments to run without the sandbox.
blinkConverterSettings.CommandLineArguments.Add("--no-sandbox");
blinkConverterSettings.CommandLineArguments.Add("--disable-setuid-sandbox");
//Set Blink viewport size.
blinkConverterSettings.ViewPortSize = new Syncfusion.Drawing.Size(1000, 0);
//Assign Blink converter settings to HTML converter.
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert HTML string to PDF
PdfDocument document = htmlConverter.Convert(pageContent, Path.GetFullPath("Services/InvoiceService"));
I have the same code working fine when running from Windows 11 and on Linux.
I have included the following packages in my project -
Syncfusion.HtmlToPdfConverter.Net.Mac
Syncfusion.HtmlToPdfConverter.Net.Windows
Syncfusion.HtmlToPdfConverter.Net.Linux
On the support site, it is suggested to copy the contents of the Chromium.app folder to the folder specified in the exception. i.e -
/Users/sathyar/Webdev/HmsBlazorServer.App/bin/Debug/net9.0/runtimes/osx/native
But I am seeing only the following folders on my machine -
- /Users/sathyar/Webdev/HmsBlazorServer.App/bin/Debug/net9.0/runtimes/osx-arm64/native
- /Users/sathyar/Webdev/HmsBlazorServer.App/bin/Debug/net9.0/runtimes/osx-x64/native
I created a symlink for a folder osx pointing to the osx-arm64 and copied over the contents of the Chromium.app file - but I am still seeing same error.
The contents of the Chromium.app looks as below -
----------
sathyar@sathyasmba Contents % ls -l
total 32
drwxrwxr-x@ 3 sathyar staff 96 29 Dec 23:00 Frameworks
-rw-rw-r--@ 1 sathyar staff 10906 29 Dec 22:46 Info.plist
drwxrwxr-x@ 3 sathyar staff 96 29 Dec 23:00 MacOS
-rw-rw-r--@ 1 sathyar staff 8 29 Dec 22:46 PkgInfo
drwxrwxr-x@ 88 sathyar staff 2816 29 Dec 23:00 Resources
----------
Any pointers to solve this issue ?
Thanks
Hi, I upgraded the Syncfusion components to 29.2.4 and now I see the following folder created
/Users/sathyar/Webdev/HmsBlazorServer.App/bin/Debug/net9.0/runtimes/osx/native
with Chromium.zip file within it. On extracting the Chromium.app's contents into this folder, I am able to generate pdf from html.
This issue may be considered closed. Thanks
Hi, I upgraded the Syncfusion components to 29.2.4 and now I see the following folder created
/Users/sathyar/Webdev/HmsBlazorServer.App/bin/Debug/net9.0/runtimes/osx/native
with Chromium.zip file within it. On extracting the Chromium.app's contents into this folder, I am able to generate pdf from html.
This issue may be considered closed. Thanks
Hi SathyaR,
Thanks for the update. Please feel free to reach out to us if you have any questions or requirements.
Regards,
Venkada Subramanian Durai
- 3 Replies
- 2 Participants
-
SA SathyaR
- May 14, 2025 09:20 AM UTC
- May 15, 2025 01:10 PM UTC