Feng Qing
Feng Qing

Reputation: 13

How to find PDF line height?

In Adobe Portable Document Format Reference 1.3 one might see

Th → horizontal spacing

txty → move text rendering location with respect to the start of the line segment

TLM → line matrix

TM → text matrix

Tf → font

TS → text rise

And the TL operator sets the vertical difference between lines in the same paragraph. As shown by Adobe Portable Document Format Reference Manual Version 1.3, the leading is measured by the unit of line heights (like 1.2 or 1.8 times of the current line height).

From where can we find the line height itself?

Upvotes: 0

Views: 4942

Answers (1)

mkl
mkl

Reputation: 95918

In pdf parsing the TL operator sets the vertical difference between lines in the same paragraph. As shown by [Adobe Portable Document Format Reference Manual Version 1.3], the leading is measured by the unit of line heights (like 1.2 or 1.8 times of the current line height).

From where can we find the line height itself?

  • If you look at the text on the image you posted with your cross-post in itext-general, you can read:

    The leading parameter, Tl , is measured in unscaled text space units.

    So not "unit of line heights like 1.2 or 1.8 times of the current line height" but "unscaled text space units". Thus, the TL parameter is NOT depending on some line height parameter. BTW, fairly often it is 0 because the automatic advance by Tl is quite seldomly used nowadays.

    If you need some line height nonetheless, have a look at the font size.

    Of course both leading and font size still are subject to the current transformation matrix and the text matrix...

  • Why on earth are you working with such an ancient PDF reference? Since 2008 the PDF specification is an ISO norm, 32000-1.

Upvotes: 2

Related Questions