How to pass Rectangle size available in Millimetre to create Docment using iTextsharp

后端 未结 1 1563
盖世英雄少女心
盖世英雄少女心 2021-01-21 17:20

I need to create a PDF file with 100mm X 150mm (Width X Height). To create this I tried to apply following:

  var doc = new iTextSharp.text.Document(new Rectangl         


        
相关标签:
1条回答
  • 2021-01-21 18:06

    The measurement used in PDF is called the user unit. By default 1 user unit equals 1 point. There are 72 points in one inch. This explains why you document is smaller than expected if you pass a value that is expressed in millimeters rather than user units.

    If you want to use millimeters and you don't want to do the Math, you can use the static millimetersToPoints() method in the Utilities class.

    0 讨论(0)
提交回复
热议问题