Image not loading when Rendering in email attachment when Trigered by API

  • I'm having issues with an image rendering in an email attachment.

    I have a PDF that has an image at the top of it. When I go into JSreports and render it, it sends an email with the image at the top just like I want. If i go through the api to render the PDF it sends the PDF but without the image at the top, not sure why it would be rendering differently.

    I thought maybe it had to do with the preview so I tried this. And I tried it set to false as well with no luck.

    function beforeRender(req, res, done) {
        req.options.preview = true

    <img src='{#image header}'/>

  • administrators

    have you tried to change the recipe to just html instead of rendering pdf? that will help in understanding why the image is not resolving correctly when rendering from an API call, try to compare the html result when rendering from the jsreport UI and when rendering from API, maybe you will discover some difference.

    another option that you can try is to use assets instead of the image feature, and see what happens when using it maybe for some reason it will work with the assets, images feature is in pending deprecation and we recommend to use assets instead.

    if anything of the above does not reveal anything i will ask you to share your code in playground and your jsreport config file here, so we can debug the problem.

  • Switched it to asset and it worked great.

Log in to reply

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.