Node-html-pdf: Cannot attach an image through an image tag !HELP!

Created on 7 Aug 2018  路  4Comments  路  Source: marcbachmann/node-html-pdf

    <img class="image" src="me.jpg">

Where the image class only has display: inline-block;

It's coming up on my html but not on my pdf.. Any reasons/help?

Most helpful comment

We are having an image in the header html. Image was added in below mentioned ways :-

  1. Image source pointing to a url.
  2. Image to a data uri.

The header image is not coming in the generated pdf.

All 4 comments

Check the "base" options to properly set the path from where html-pdf shoudl fetch the image

We are having an image in the header html. Image was added in below mentioned ways :-

  1. Image source pointing to a url.
  2. Image to a data uri.

The header image is not coming in the generated pdf.

You can try this instead of giving image path in config.header

<div id="page-header"><img src="LIVEURLOFYOURIMAGE" /></div>

Try putting the full URL of the image or you can use the base property in the config for base URL.
Use file://PATH for local files

But it only works on HTML body, it doesn't work on pdf header/footer

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aminjoharinia picture aminjoharinia  路  4Comments

RodolfoSilva picture RodolfoSilva  路  3Comments

wobsoriano picture wobsoriano  路  3Comments

OussamaRomdhane picture OussamaRomdhane  路  4Comments

qianweicheng picture qianweicheng  路  5Comments