Skip to content

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

@mojixcoder

Description

@mojixcoder

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions