Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iTextSharp units

Tags:

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.

like image 256
Sebastian Avatar asked Sep 16 '09 18:09

Sebastian


2 Answers

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).

like image 59
David Avatar answered Oct 23 '22 09:10

David


pointsValue = iTextSharp.text.Utilities.MillimetersToPoints(mmValue) 

and more options here https://sourceforge.net/p/itextsharp/itextsharp/ci/31e03918bb1eedc8f0d9efe56b982dfcee7aaa4d/tree/src/core/iTextSharp/text/Utilities.cs#l189

like image 32
fedeteka Avatar answered Oct 23 '22 09:10

fedeteka