What is the relationship between PDF file size (A4) and PX?

PageSize.getA4().getWidth()  //595.0
PageSize.getA4().getHeight()  //842.0

QQ图片20220311143037.png (55.5 KB)

The total height is 842, minus the top and bottom margin (25), the content area height should be: 842.0-25.0-25.0 = 792.

Instead, the content area is filled with 10 100px images. How to determine PDF height and image height (PX)?

@gaohf

The measurement unit in Aspose.PDF is point where 72 Points = 1 Inch. The Image width and height are calculated in points as well. In case you need to get image dimensions in pixels, you can extract images using ImagePlacementAbsorber and calculate the dimensions using below formula:

width = ImagePlacement.Rectangle.Width * ImagePlacement.Resolution.X / 72
height = ImagePlacement.Rectangle.Height * ImagePlacement.Resolution.Y / 72