Skip to content
Discussion options

You must be logged in to vote

This works as you seem to intend:

html = """<div style="text-align:center;"><img src="image2.jpg" height=100><br>tagline</div>"""
arch = fitz.Archive(".")
rect = fitz.Rect(100, 100, 500, 400)
doc = fitz.open()
page = doc.new_page()
page.insert_htmlbox(rect, html, archive=arch)
page.draw_rect(rect, color=(1, 0, 0))
doc.ez_save(__file__.replace(".py", ".pdf"))

BTW I am amazed that you were successful using embedded image data. The documentation clearly says, that this is not supported ... only external images are.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@JorjMcKie
Comment options

@JorjMcKie
Comment options

Answer selected by varun-rf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants