We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Wrapping an <img> with the <a> tag seems to have no effect. Hence, cannot add images as links.
<img>
<a>
from xhtml2pdf import pisa source_html = """<html> <body> <a href="http://www.stackoverflow.com"> <img src="https://dummyimage.com/1038x450/000/0011ff&text=sample+image"/> </a> </body> </html>""" output_filename = "output.pdf" result_file = open(output_filename, "w+b") pisa.CreatePDF( source_html, dest=result_file) result_file.close()
The image should be a hyperlink.
The image is not a hyperlink.
There is a hacky solution: https://stackoverflow.com/questions/32833922/unable-to-create-an-image-hyperlink-with-xhtml2pdf/35300776#35300776 for this, but it does not work with a larger image size.
OS version: macOS Sonoma 14.4.1 Python version: 3.8 XHTML2PDF version: 0.2.15
The text was updated successfully, but these errors were encountered:
+1
Sorry, something went wrong.
No branches or pull requests
Describe the Bug
Wrapping an
<img>
with the<a>
tag seems to have no effect. Hence, cannot add images as links.Minimal Example to Reproduce
Expected Behavior
The image should be a hyperlink.
Actual Behavior
The image is not a hyperlink.
Additional Information
There is a hacky solution: https://stackoverflow.com/questions/32833922/unable-to-create-an-image-hyperlink-with-xhtml2pdf/35300776#35300776 for this, but it does not work with a larger image size.
System Information
OS version: macOS Sonoma 14.4.1
Python version: 3.8
XHTML2PDF version: 0.2.15
The text was updated successfully, but these errors were encountered: