In iTextSharp:
Is pagesize.getTop(0) same as pagesize.Top? and similarly for other coordinates like pagesize.getLeft(0) and pagesize.Left?
See following code:
PdfReader PDFReader = new PdfReader("c:\\file.pdf");
iTextSharp.text.Rectangle PageSize = PDFReader.GetCropBox(1);
PageSize.Left;
PageSize.GetLeft(0);
PageSize.Top;
PageSize.GetTop(0);
Is
pagesize.GetTop(0)
same aspagesize.Top
? and similarly for other coordinates likepagesize.GetLeft(0)
andpagesize.Left
?
Yes.
The methods GetTop(float)
allows you to automatically have a margin value applied to the border, and for a margin of 0
you get the original border.
Looking into the source code, they are essentially the same. https://github.com/itext/itextsharp/blob/master/src/core/iTextSharp/text/Rectangle.cs#L451 https://github.com/itext/itextsharp/blob/master/src/core/iTextSharp/text/Rectangle.cs#L534
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.