for this we have tried QtBinariesWindows with syncfusion html to pdf converter. but getting blank pdf, event after waiting for some time for page load.
We have tried with blink binaries also.
Code we are using is this
[HttpGet("ExportToPDF")]
public IActionResult ExportToPDF()
{
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = Path.Combine(hostingEnvironment.ContentRootPath, "QtBinariesWindows");
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("URL");
MemoryStream stream = new MemoryStream();
document.Save(stream);
//document.Close(true);
return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "Output.pdf");
}
it would be good if there is any function where it wait for page to load fully, we have tried some regarding that but still getting blank pdf