BoldSign®Effortlessly integrate e-signatures into your app with the BoldSign® API. Create a sandbox account!
Hi there. I've made a new project for testing and it ocurred the same. configuring or not the BlinkPath.
Using Macbook Pro M2.
C# .NetCore MVC
Syncfusion.Pdf.PdfException: "Blink files are missing at /BlinkBinaries/"
at Syncfusion.HtmlConverter.BlinkConverter.GetBlinkPath()\n at Syncfusion.HtmlConverter.BlinkConverter.Convert(String url)\n at Syncfusion.HtmlConverter.HtmlToPdfConverter.Convert(String url)\n at SYNCFUSION_HTML_TO_PDF.Controllers.HomeController.Export() in /Users/user/Projects/SYNCFUSION-HTML-TO-PDF/SYNCFUSION-HTML-TO-PDF/Controllers/HomeController.cs:48
Sample:
public IActionResult Export()
{
//Initialize HTML converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
// Blink converter settings
BlinkConverterSettings blinkSettings = new BlinkConverterSettings();
//Assign the Blink binaries path
blinkSettings.BlinkPath = @"/BlinkBinaries/";
//Add post parameters
blinkSettings.HttpPostFields.Add("firstName", "Andrew");
blinkSettings.HttpPostFields.Add("lastName", "Fuller");
//Assign the Blink settings
htmlConverter.ConverterSettings = blinkSettings;
//Convert HTML to PDF
PdfDocument document = htmlConverter.Convert("http://asp.syncfusion.com/demos/http_post_get/default.aspx");
//Create memory stream.
MemoryStream stream = new MemoryStream();
//Save and close the document.
document.Save(stream);
document.Close();
return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "HTML-to-PDF.pdf");
}
Can i solve it?
There is no need to set the BlinkPath in BlinkConverterSettings in sample level. For Mac, we have to manually extract the Chromium.app.zip folder in bin folder of the application for the first time. You can overcome the reported issue by unzipping the Chromium.app into the specified folder (bin/Debug/net6.0/runtimes/osx/native) and try the conversion.
It worked out! Thanks a lot!