[Html2PdfConverter] How to add image logo in header of PDF while using HtmlToPdf Converter

[Html2PdfConverter] How to add image logo in header of PDF while using HtmlToPdf Converter

  
Forge Component
(51)
Published on 26 Sep (3 weeks ago) by Guilherme Pereira
51 votes
Published on 26 Sep (3 weeks ago) by Guilherme Pereira

Hi,

How to add an image logo in header of PDF while using HtmlToPdf Converter.

Can any one please help me how can I add it.

Thanks.

Hi Pratima,

Html2Pdf accepts URL of html page as input so add image tag in header of html and add the logo url in that . HtmlToPdf will load all the images by itself and will generate a PDF 

Regards

Devendra

Devendra Baghel wrote:

Hi Pratima,

Html2Pdf accepts URL of html page as input so add image tag in header of html and add the logo url in that . HtmlToPdf will load all the images by itself and will generate a PDF 

Regards

Devendra


Hi Devendra,

Actually, I am using the header-html and passing the url as you can see in attached file.I have set this value in otherargs of html2pdfconverter action.

That's what you are also saying right?

Thanks.

Hi Pratima,

It seems like you are going on right path. The Html2PdfConverter component is a wrapper of  wkhtmltopdf command line tool that creates pdf documents or images from html pages . So better download the tool from https://wkhtmltopdf.org/ and check the output locally first and if that works then check the version of tool uploaded on server .

Regards

Devendra

Devendra Baghel wrote:

Hi Pratima,

It seems like you are going on right path. The Html2PdfConverter component is a wrapper of  wkhtmltopdf command line tool that creates pdf documents or images from html pages . So better download the tool from https://wkhtmltopdf.org/ and check the output locally first and if that works then check the version of tool uploaded on server .

Regards

Devendra


Hi Devendra,

I have tried it but after putting this html link into the pdf it's taking the whole html page and overriding the pdf content and displaying blank page with no content in it.

Can you please share an example?

Thanks.

Hi Pratima,

You need to give the size that you need header explicitly in below example 50mm header is used from google.com 

wkhtmltopdf.exe -T 50mm --header-html www.google.com www.stackoverflow.com test.pdf && test.pdf