Skip to content
Discussion options

You must be logged in to vote

You are free to use it immediately - without it already being released. All you have to do is import the script enabling this from an extra file like this:

import fitz
import pathlib
from htmlbox import insert_htmlbox

fitz.Page.insert_htmlbox = insert_htmlbox  # mix it into the Page object


text = "some mixture of plain text or html ..."
doc = fitz.open()
page = doc.new_page()
clip = fitz.Rect(200, 200, 500, 400)
css = "body {font-family: sans-serif;}"  # example extra styling
rc = page.insert_htmlbox(clip, text,
    css=None,
    rotate=0,  # one of 0, 90, 180, 270
    adjust=True,  # whether to reduce font size until text fits in clip
    morph=None,
    overlay=True,
)
print(rc)  # f…

Replies: 41 comments 33 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@JorjMcKie
Comment options

Comment options

You must be logged in to vote
6 replies
@ousia
Comment options

@subalalithafl
Comment options

@ousia
Comment options

@subalalithafl
Comment options

@JorjMcKie
Comment options

Comment options

You must be logged in to vote
7 replies
@subalalithafl
Comment options

@JorjMcKie
Comment options

@JorjMcKie
Comment options

@subalalithafl
Comment options

@JorjMcKie
Comment options

Comment options

You must be logged in to vote
1 reply
@JorjMcKie
Comment options

Comment options

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

@JorjMcKie
Comment options

Comment options

You must be logged in to vote
6 replies
@sanchayjain28
Comment options

@JorjMcKie
Comment options

Answer selected by JorjMcKie
@sanchayjain28
Comment options

@arjunpaudyal
Comment options

@JorjMcKie
Comment options

@arjunpaudyal
Comment options

Comment options

You must be logged in to vote
5 replies
@sanchayjain28
Comment options

@sanchayjain28
Comment options

@JorjMcKie
Comment options

@JorjMcKie
Comment options

@sanchayjain28
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

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

@JorjMcKie
Comment options

@JorjMcKie
Comment options

@JorjMcKie
Comment options

@sanchayjain28
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolved fixed / implemented / answered
8 participants
Converted from issue

This discussion was converted from issue #398 on December 10, 2020 15:07.