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

Why it doesn't load images in PDF? #28

Open
mojixcoder opened this issue Dec 8, 2021 · 1 comment
Open

Why it doesn't load images in PDF? #28

mojixcoder opened this issue Dec 8, 2021 · 1 comment

Comments

@mojixcoder
Copy link

In the rendered PDF images are not loaded.

here is main.py

import pydf


html_str = """
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <title>بن اعتباری</title>
  </head>
  <body>
      <img src="./pizza.jpg" />
  </body>
</html>
"""



pdf = pydf.generate_pdf(html_str)
with open("test_doc.pdf", "wb") as f:
    f.write(pdf)

and image exists in that directory and everything is fine in html file

@justin-richert
Copy link

@mojixcoder I think this will probably answer your question! wkhtmltopdf/wkhtmltopdf#4723

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

No branches or pull requests

2 participants