535
Views
5
Comments
[Html2PdfConverter] How to add image logo in header of PDF while using HtmlToPdf Converter
Question
Forge component by Miguel 'Kelter' Antunes
72
Published on 02 Jun 2020

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.

Rank: #1382

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

Rank: #4343

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.

Rank: #1382

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

Rank: #4343

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.

Rank: #1382

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