Is there any way to figure out the height and width (in pixels) of the text inserted? #145
|
I am using function pdf_add_text_wrap to add text to the pdf. However, given the string, font family and the font size, is there any way to calculate the expected width and height the string might take on the paper. This will be really benefical as I am trying to build a insert table function from this library. |
Answered by
AndreRenaud
Feb 13, 2024
Replies: 1 comment
|
|
0 replies
Answer selected by
AndreRenaud
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pdf_add_text_wrapalready takes the width as an argument, so that is known, and it returns the height in*height- one of its parameters. This is all after the fact though, but is that enough for you to know where to put the lines for the table (basically x + width + border and y + height + border)?