20
votes

Anyone knows what unit system does iTextSharp uses? My first assumption would be pixels but I'm not sure about it.

Thanks!

EDIT: Sorry to not being more specific, and thanks for letting me know. I'm talking about units for measures in the PageSize and Margins.

2
PageSize and Margins both use the same units as everything else (points). So a left margin of 36 would be a half inch margin. - David
However I think both of those are a bit difficult if you want an exact value, since the easy way of setting them expects an int (restricting you to even multiples of 1/72 of an inch, not nice if you need to match a metric page template). I can't remember if you could define a custom page template to get around that or if it was a limitation baked into the PDF standard. - David
It's really obnoxious when documentation for a library says something like "int waitDuration - the duration to wait" without specifying the units of measure. I would be embarrassed to put out documentation with meaningless descriptions like that. Here, iTextSharp documentation says "Parameters: pageSize - the pageSize" Thanks a lot! - Jason Kleban

2 Answers

25
votes

If I remember correctly it uses "points", the same unit of measurement as a font (as PDF is centered around correct font rendering).

One "point" is 1/72 of an inch (or about 0.353mm).