Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images not showing in PDF #32

Open
gdubois414 opened this issue Sep 17, 2019 · 1 comment
Open

Images not showing in PDF #32

gdubois414 opened this issue Sep 17, 2019 · 1 comment
Assignees

Comments

@gdubois414
Copy link

Description

I am referencing an image in my html, and it is not showing in the PDF. I can navigate directly to the image, so I know it exists. This is a recent change, and everything else is still working fine.

Steps to reproduce

  1. Reference image in html
  2. View PDF generated from html

Additional info

  • Craft version: 3.1.31
  • PHP version: 7.2.19
  • Database driver & version: MySQL 5.7.27
  • Plugin version: Latest
@andrelopez andrelopez self-assigned this Oct 7, 2019
@eirabben
Copy link

I had the same problem, but resolved it by adding the proper HTML to the template.

This does not work:

{% set html %}
    <img src="{{ image.url }}" />
{% endset %}

{% set settings = { ... } %}
{{ craft.enupalsnapshot.displayHtml(html, settings) }}

This works:

{% set html %}
    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="UTF-8">
            <title>PDF template</title>
	</head>
	<body>
	    <img src="{{ image.url }}" />
	</body>
    </html>
{% endset %}

{% set settings = { ... } %}
{{ craft.enupalsnapshot.displayHtml(html, settings) }}

The same thing applies when using a twig template instead of the html variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants