Using
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Net.Linux" Version="29.1.39" />
I get this exception trying to convert html to pdf with this code:
var htmlConverter = new HtmlToPdfConverter();
var settings = new BlinkConverterSettings
{
PdfPageSize = PdfPageSize.A4,
Margin = { All = 0 },
CommandLineArguments =
{
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-dev-shm-usage",
"--disable-gpu",
"--headless",
"--disable-crash-reporter",
"--no-crashpad"
},
EnableAutoScaling = true
};
htmlConverter.ConverterSettings = settings;
logger.LogInformation("Blink path: {BlinkPath}", settings.BlinkPath);
using var document = htmlConverter.Convert(htmlContent, "");
System.InvalidOperationException: Error generating PDF
Apr 23 16:39:25 ip-172-31-39-106 somi-system-web[1930584]: ---> Syncfusion.Pdf.PdfException: Failed to launch Base!
Apr 23 16:39:25 ip-172-31-39-106 somi-system-web[1930584]: ---> Syncfusion.HtmlConverter.Blink.ProcessException: Failed to launch Base!
Apr 23 16:39:25 ip-172-31-39-106 somi-system-web[1930584]: at Syncfusion.HtmlConverter.BlinkConverter.BlinkResult(Stream outputStream)
Apr 23 16:39:25 ip-172-31-39-106 somi-system-web[1930584]: at Syncfusion.HtmlConverter.BlinkConverter.ConvertToPdf(String url, PdfDocument& document)
Apr 23 16:39:25 ip-172-31-39-106 somi-system-web[1930584]: --- End of inner exception stack trace ---
Apr 23 16:39:25 ip-172-31-39-106 somi-system-web[1930584]: at Syncfusion.HtmlConverter.BlinkConverter.Convert(String url)
Apr 23 16:39:25 ip-172-31-39-106 somi-system-web[1930584]: at Syncfusion.HtmlConverter.BlinkConverter.Convert(String htmlString, String baseurl)
Apr 23 16:39:25 ip-172-31-39-106 somi-system-web[1930584]: at Syncfusion.HtmlConverter.HtmlToPdfConverter.Convert(String html, String baseurl)
Hi Miloš Faltýnek,
Thank you for reaching out to Syncfusion support.
We have reviewed the issue you reported and tested the HTML to PDF conversion functionality in a Linux environment. Based on our analysis, we were unable to reproduce the problem with the details currently provided. The conversion process is working as expected on our end.
To help us investigate further and provide a prompt resolution, we kindly request you to share a reproducible sample, along with the complete code snippet, input HTML document, .NET version, and environment details. These details will enable us to better understand the context and identify any potential issues.
For your reference, we’ve attached a working sample project from our GitHub repository:
Please try running this sample in your environment and let us know the outcome. If the issue still persists, we would appreciate it if you could provide the requested information to proceed further with the investigation.
Regards,
Arumugam M
I am also seeing this error
[2025-04-29T21:28:44.157Z] Error: Syncfusion.Pdf.PdfException: Failed to launch Base! [2329:2329:0429/212842.916463:FATAL:spawn_subprocess.cc(237)] posix_spawn /tmp/chrome_crashpad_handler: No such file or directory (2)
#0 0x5b3bb89126c2 (/tmp/chrome+0x94926c1)
#1 0x5b3bb88ff52e (/tmp/chrome+0x947f52d)
#2 0x5b3bb88574ca (/tmp/chrome+0x93d74c9)
#3 0x5b3bb8858316 (/tmp/chrome+0x93d8315)
#4 0x5b3bbb72c2ad (/tmp/chrome+0xc2ac2ac)
#5 0x5b3bbb7296af (/tmp/chrome+0xc2a96ae)
#6 0x5b3bbb72f7f6 (/tmp/chrome+0xc2af7f5)
#7 0x5b3bbb726208 (/tmp/chrome+0xc2a6207)
#8 0x5b3bb36cb342 (/tmp/chrome+0x424b341)
#9 0x5b3bb7be3d85 (/tmp/chrome+0x8763d84)
#10 0x5b3bb7be214c (/tmp/chrome+0x876214b)
#11 0x5b3bb7be2527 (/tmp/chrome+0x8762526)
#12 0x5b3bb36c9385 (/tmp/chrome+0x4249384)
#13 0x7a733a11a24a (/usr/lib/x86_64-linux-gnu/libc.so.6+0x27249)
#14 0x7a733a11a305 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x27304)
Hi Miloš Faltýnek,
We have checked the reported chrome_crashpad_handler issue on our end, we found that the reported error occurs due to the missing chrome_crashpad_handler file in the Blink binaries location. This issue can be resolved by including the file in the runtimes folder and setting its "Copy to Output Directory" property to "Copy Always". We have attached the missing file and relevant screenshots for your reference.
Missing binary file: chrome_crashpad_handler.zip
Kindly try the provided solution on your end. If you are still facing the issue, we kindly request you to share the environment details (OS, bit version, RAM, etc.) so we can replicate the reported issue on our side. This information will help us analyze and assist you further.
Regards,
Karmegam
Check dependencies and ensure Blink binaries are properly configured for Linux.
Hi Brock,
We would like to inform you that the chrome_crashpad_handler file has been included in the Blink binaries as part of our latest NuGet package update (v29.1.41). You can download the updated package from the following link:
NuGet: NuGet Gallery | Syncfusion.HtmlToPdfConverter.Net.Linux 29.1.41
Root cause: The issue you reported was due to the absence of the chrome_crashpad_handler file in the Blink binaries. Since our HTML-to-PDF conversion relies on the Blink rendering engine internally, the missing file caused unexpected behavior during the conversion process in Linux environments.
Regards,
Arumugam M
Hello, I get same error with windows server 2022 IIS server environment. I use Asp.net core Razor pages. It works as normal on my local but when I setup to IIS server, it does not work and give error: I added c:/windows/temp folder permission to IIS_IUSERS. What to do more to make it work? I also added publish settings.
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
An unhandled exception has occurred while executing the request.
Syncfusion.Pdf.PdfException: Failed to launch Base!
---> Syncfusion.HtmlConverter.Blink.ProcessException: Failed to launch Base!
at Syncfusion.HtmlConverter.BlinkConverter.BlinkResult(Stream outputStream)
at Syncfusion.HtmlConverter.BlinkConverter.ConvertToPdf(String url, PdfDocument& document)
--- End of inner exception stack trace ---
at Syncfusion.HtmlConverter.BlinkConverter.Convert(String url)
at Syncfusion.HtmlConverter.HtmlToPdfConverter.Convert(String url)
at AthlantysLab.Web.Pages.Raporlama.RaporGoruntuleModel.OnGet() in D:\Projects\Git\AthlantysLab\AthlantysLab.Web\Pages\Raporlama\RaporGoruntule.cshtml.cs:line 124
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>. My code attached.
My code:
public async Task<IActionResult> OnGet()
{
if (string.IsNullOrEmpty(RaporId) && NumuneId == 0)
{
TempData[SD.SwalNotificationError] = "Numune Seçilmedi!";
return RedirectToPage("/raporlama/index");
}
if (IsTaslak == null)
{
IsTaslak = false;
}
if (NumuneId != 0)
{
var raporFormati = "";
switch (Dil.ToLower())
{
case "en":
{
raporFormati = "RaporFormatiEn";
break;
}
case "tr":
{
raporFormati = "RaporFormatiTr";
break;
}
case "tren":
{
raporFormati = "RaporFormatiTrEn";
break;
}
}
var numune = await _numuneService.GetFirstOrDefaultAsync(a => a.Id == NumuneId);
if (numune == null)
{
TempData[SD.SwalNotificationError] = "Numune Bulunamadı!";
return Page();
}
Numune = numune;
string authCookie = HttpContext.Request.Cookies[".AspNetCore.Identity.Application"];
if (string.IsNullOrEmpty(authCookie))
{
throw new Exception(
"Authentication cookie (.AspNetCore.Identity.Application) not found or is empty.");
}
// Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
BlinkConverterSettings blinkSettings = new BlinkConverterSettings
{
Cookies = new CookieCollection(),
ViewPortSize = new Syncfusion.Drawing.Size(816, 1152),
Margin = new PdfMargins()
{
All = 0
},
EnableAutoScaling = false
};
// Add the authentication cookie
blinkSettings.Cookies.Add(".AspNetCore.Identity.Application", authCookie);
htmlConverter.ConverterSettings = blinkSettings;
if (string.IsNullOrEmpty(RaporId) && NumuneId != 0)
{
string baseUrl = $"{Request.Scheme}://{Request.Host}";
// Convert URL to PDF document
PdfDocument document =
htmlConverter.Convert(
$"{baseUrl}/raporlama/raporformatlari/{raporFormati}?IsTaslak={IsTaslak}&NumuneId={NumuneId}&IsImzali={IsImzali}");
// Create memory stream
using (MemoryStream stream = new MemoryStream())
{
document.Save(stream);
document.Close();
// Get the temp path
var tempPath = Path.Combine(_env.ContentRootPath, "temp");
// Ensure the directory exists
if (!Directory.Exists(tempPath))
Directory.CreateDirectory(tempPath);
// Set file name
var fileName = $"Report-{DateTime.Now:yyyyMMddHHmmss}.pdf";
var fullPath = Path.Combine(tempPath, fileName);
// Save to file system
System.IO.File.WriteAllBytes(fullPath, stream.ToArray());
PdfUrl = fullPath;
}
}
}
return Page();
}
Hi Senol,
We have investigated the reported issue on our end. Recently, we upgraded Chromium from version 120.x.x to the latest stable release (133.x.x) as part of package version 29.X.X. The issue began occurring after this upgrade.
In the latest Chromium source code, a new condition was introduced to check for the existence of the required locale folder within the dependency directory. However, when setting the win-x64 runtime identifier in the publish profile, only the files are copied to the root directory—without preserving the folder structure. As a result, Chromium fails to locate the expected locale folder, triggering the reported exception.
Please find the relevant Chromium source code screenshot and link below for reference.
To overcome this, we have two workaround solutions.
Kindly try this solution and get back to us if you need further assistance.
Regards,
Karmegam
We are glad to know that the provided solution resolved the issue. Please feel free to reach out if you need any further assistance.