htmlconverter webkit engine header on every page

hi,

in a blazor server app i define  htmlconvert with WebKitConverterSettings:

WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
 webKitSettings.WebKitPath = webkitFolder;
 webKitSettings.EnableJavaScript = true;
 webKitSettings.Margin = new PdfMargins { All = 40 };
 webKitSettings.EnableRepeatTableHeader=true;
 webKitSettings.MediaType = MediaType.Print;
 webKitSettings.PdfPageSize = PdfPageSize.A4;
 htmlConverter.ConverterSettings = webKitSettings;
 using (PdfDocument pdfDocument = htmlConverter.ConvertPartialHtml(url,DivName))
 {
   using (MemoryStream stream = new MemoryStream())
   {
      pdfDocument.Save(stream);
      pdfDocument.Close(true);
      return stream;
   }
 }

webKitSettings.EnableRepeatTableHeader=true; the header repeat every page, but is overlaping from second page with the content, and pdf has additional page at end

i don't sure where is the problem, the rest of convert pdf is perfect

attached, image of overlaping and file razor to convert,

also i have try with blink engine but I can't get it to use the css


thanks in advance






Attachment: headeroverlap_fb6434b4_7c8e56e1.7z

1 Reply

GK Gowthamraj Kumar Syncfusion Team June 1, 2022 11:54 AM UTC

Hi Sergio Cabello,

In the provided attachment, we found the third party or external class are used to fill the values, due to this we could not able to test the provided razor component page. We have created a sample to convert the HTML table to PDF document with test document, it is working properly. We have attached the sample and output document for your reference, please try the sample on your end and let us know the result.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/HtmlToPDF_Blazor-1848833783

Output: https://www.syncfusion.com/downloads/support/directtrac/general/pd/BlazorSample-1543662886

Note: Run the application à Go to Fetch Data page à Click Html to PDF button to convert the provided webpage to PDF document.


KB: https://www.syncfusion.com/kb/12818/how-to-convert-html-to-pdf-in-blazor-using-c


We request you to save the input HTML content which is parsed to the convert method in a separate text file and share those file with it resource files to check the issue on our end. So that it will helpful for us.


Regards,

Gowthamraj K


Loader.
Up arrow icon