We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

HtmlToPdfConverter HTMLFile from URL as PDF Header and PDF Footer

Can you please help me to Add HTML Content from URL as PDF Header and Footer? I'm creating a PDF document from URL using HtmlToPdfConverter in the same document I would like to append add header and footer content from a URL .

Please guide me through the steps to achieve the desired output.

9 Replies

SK Sasi Kumar Sekar Syncfusion Team June 26, 2017 11:28 AM UTC

Hi Satheesh, 
 
Thank you contacting Syncfusion support, 
We can convert each HTML to PDF(Header, body(actual HTML), footer) separately and then draw it in the new PDF document as it looks like header and footer added.  
  
1)      Convert the header and footer HTML to PDF with page height 100pt.  
2)      Create the actual HTML(body) to PDF.  
3)      Get the header and footer as template and draw it in the new document on the top and bottom of the page respectively.  
4)      Then get the actual (body) PDF and draw in between the header and footer(in the new document).  
5)      But this needs 3 level of HTML to PDF conversion. 
 
 
Please find the sample to convert the HTML as header and footer of the PDF page. 
Sample link: 
Please let us know if you need further assistance on this. 
Regards, 
Sasi Kumar S. 



JL James Lau December 5, 2017 08:29 AM UTC

It is possible change the height/width of header, footer. according to the html content?


PV Prakash Viswanathan Syncfusion Team December 6, 2017 12:55 PM UTC

Hi James, 

Thanks for using Syncfusion products.  

Our WebKit HTML converter do not have direct support for calculating the header width/height based on the input HTML. As a workaround, we can use SinglePageLayout to adjust the height of header/footer. We have attached workaround sample to calculate the header/footer height based on the input HTML. Please find the sample from below link, 


Regards, 
Prakash V 



SA Sarim July 8, 2020 07:02 AM UTC

The document created in the sample code is through API, what about if our document is generated with the HTML to pdf convertor. 


GK Gowthamraj Kumar Syncfusion Team July 13, 2020 12:12 PM UTC

Hi Sarim, 

We have already generated a PDF document from using our HTML to PDF Converter. Can you please provide more information about your requirement to check the scenario in our end. So, that it will be helpful for us to analyze and assist you further on this. 

Gowthamraj K. 



HA hamariwishes replied to Sasi Kumar Sekar June 12, 2022 12:28 AM UTC

It is possible to change it features such as header.

https://icccricketworldcup2019.net/smartcric-live-ipl/



GK Gowthamraj Kumar Syncfusion Team June 13, 2022 12:52 PM UTC

Hi hamariwishes

At present, Syncfusion HTML converter do not have direct support for adding header or footer from HTML file. As a workaround, we can convert each HTML data to PDF (Header, body (actual HTML), footer) separately and then draw it in the new PDF document as it looks like header added.

Please refer the below link for more information,

KB (Html) : https://www.syncfusion.com/kb/8196/how-to-add-html-as-header-and-footer-in-pdf-while-converting-html-to-pdf

KB: https://www.syncfusion.com/kb/8381/how-to-add-pdf-header-and-pdf-footer-while-converting-html-to-pdf


We requested you to share your exact requirement details, so that we can check and share the solution.

  • Whether you want to change the header which is in the html page? or what type of changes you want to do?
  • Change the content of header from Html page?
  • Expected output screenshot
  • More details on your header requirement


Regards,

Gowthamraj K



PT pesu toksen September 28, 2022 03:07 AM UTC

is it good to convert the footer like this .



GK Gowthamraj Kumar Syncfusion Team September 28, 2022 01:22 PM UTC

Hi pesu toksen,


Yes. At present, Syncfusion HTML converter do not have direct support for adding header or footer from HTML file. As a workaround, we can convert each HTML data to PDF (Header, body (actual HTML), footer) separately and then draw it in the new PDF document as it looks like the header and footer added. This is our suggested approach to add header and footer while converting HTML to PDF.


Please refer the below link for more information,

KB (Html) : https://www.syncfusion.com/kb/8196/how-to-add-html-as-header-and-footer-in-pdf-while-converting-html-to-pdf

KB: https://www.syncfusion.com/kb/8381/how-to-add-pdf-header-and-pdf-footer-while-converting-html-to-pdf


If you are facing any issue, we request you to share the details with input HTML document, output document to check on our end. So that it will helpful for us.

Regards,

Gowthamraj K


Loader.
Live Chat Icon For mobile
Up arrow icon