Skip to content

draw_text and text_box have different coordinates origin #1255

Answered by gettalong
paniko0 asked this question in General
Discussion options

You must be logged in to vote

Haven't looked at the code but I guess the difference is because of different text origins.

With #draw_text you define the lower-left corner where drawing should be done since this method is basically a one-to-one mapping of the PDF text drawing command. Therefore the word "draw" appears above the 400 line.

With #text_box you use a high-level method that defines a box into which text should be drawn. And the at option defines the upper-left corner of this box (see the API spec, therefore the text appears below the 400 line.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pointlessone
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1123 on February 18, 2022 09:34.