Closed Elvander closed 3 years ago
I am having the same problem. Images are not shown in PDF output. Currently using 0.5.8, but it stopped few versions back.
Here is reproducible demo. It shows in build:
https://ci.appveyor.com/project/majkinetor/mm-docs-template#L61
ERROR: Relative URI reference without a base URI: <img src="/mm-docs-template/files/omg-lolcat.jpg">
Here are the artifacts:
PDF: https://majkinetor.github.io/mm-docs-template/demo/demo.pdf#page=3
This is the full code for docker image: https://github.com/majkinetor/mm-docs
It worked before, not sure when it stopped. The only suspicious thing in the build output is:
/usr/lib/python3.6/site-packages/weasyprint/document.py:36: UserWarning: There are known rendering problems and missing features with cairo < 1.15.4. WeasyPrint may work with older versions, but please read the note about the needed cairo version on the "Install" page of the documentation before reporting bugs. http://weasyprint.readthedocs.io/en/latest/install.html
I've found the reason. The path for the image's while generating the PDF's is relative to the path of the md-file.
If you link the images relative to the md file the PDF generation works
![Pagina aanmaken](../../../images/signage/nl_signage_incident_aanmaak.png)
instead of
![Pagina aanmaken](/images/signage/nl_signage_incident_aanmaak.png)
I hope this helps others with the same issue!
On the output PDF I have an issue with the images not being loaded.
ERROR - Relative URI reference without a base URI: <img src="/images/nl_signage_bewerk_widget.png">
I'm running version 0.5.8.
This appeared to be solved in the 0.5.1b https://github.com/zhaoterryy/mkdocs-pdf-export-plugin/issues/28#issuecomment-457240296