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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

HtmlToPdfConverter HTMLFile from URL as PDF Header and PDF Footer

Thread ID:

Created:

Updated:

Platform:

Replies:

131142 Jun 23,2017 05:28 AM UTC Dec 6,2017 12:55 PM UTC ASP.NET MVC 3
loading
Tags: PDF
Satheesh Kumar
Asked On June 23, 2017 05:28 AM UTC

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.

Sasi Kumar Sekar [Syncfusion]
Replied On 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. 


James Lau
Replied On December 5, 2017 08:29 AM UTC

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

Prakash Viswanathan [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;