How do I calculate leading in a PDF document?
For example:
48 0 0 48 72 677.28 Tm
(Hello World) Tj
0 -1.1075 TD
This renders the text Hello World at 48pt/57.6pt (120% line height) in Times-Roman
.
According to the PDF Reference manual, "the leading parameter is measured in unscaled text space units. It specifies the vertical distance between the baselines of adjacent lines of text... The number is expressed in thousandths of a unit of text space."
Can someone please explain how 1.1075
and 57.6
are related?
The leading is usually set in the PDF by the command TL, just like this:
That 12 indicates a leading of 12 points until another TL is found.
I hope it helps you. I think this is the easiest way to do it :)