Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: PDF::API2 - Test text that will fit in area

by ltriant (Scribe)
on Nov 11, 2013 at 22:12 UTC ( #1062063=note: print w/replies, xml ) Need Help??


in reply to PDF::API2 - Test text that will fit in area

Look at the advancewidth() method in PDF::API2::Content for the width of the text you want to write given the current text object's state, and, for height, I personally just used the rule of thumb that 0.6 x font size (in points) will give me a good-enough approximate height of the text I'm about to write.

Hope that helps.

Replies are listed 'Best First'.
Re^2: PDF::API2 - Test text that will fit in area
by snoopy (Deacon) on Nov 12, 2013 at 00:20 UTC
    Seconded.

    Here's a hack to temporarily turn-off output, if you're wanting to pre-compute sizes using one of the higher-level methods such as text_center() or paragraph() - Re: PDF::API2 paragraph vertical align.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1062063]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2018-06-23 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (125 votes). Check out past polls.

    Notices?