2

I have followed exactly the code here: Convert HTML into PDF using Python, but my images are still not showing up. They have absolute URLs, in any case.

xhtml2pdf and reportlab are both placed in my app folder as modules, so no import errors pop up or anything. The PDF renders fine, except that images are not being displayed. I tried to remove HTML and CSS width/height attributes as well to no avail.

Any pointers?

Community
  • 1
  • 1
Alvin Tan
  • 119
  • 1
  • 6

2 Answers2

0

I've seen the same issue when running my App Engine based application locally. The issue centers around my install of PIL.

The PDFs render as expected and with images up in the cloud.

Tombatron
  • 1,567
  • 1
  • 13
  • 27
0

For some reasons I had this issue when the @frame was too small compare to image. When I tried to render it outside frames - it worked. So the solution was to use zoom: 20% and adjust frame's width and height. Note, that img { zoom: 20% } doesn't work inside the @frame definition for some reasons so I had to move it to global scope (even outside the @page definition).

Andrii Zarubin
  • 2,165
  • 1
  • 18
  • 31