Some time ago, we created a class that adds an image to a PDF file. This worked perfectly back then. Recently however, we needed to upgrade Aspose.Pdf.Kit.dll to the latest version, and after this the image seems to be cropped somehow.
Also when we print the PDF file, there seems to be a very (very, very) light watermarked border around the image.This border was not present when using the older version of Pdf Kit.
The old version we used was: Aspose.Pdf.Kit, Version 3.1.0.0
The current version we are using: Aspose.Pdf.Kit, Version 5.1.0.0
I have tested this issue using the latest version and attached the output PDF file with this post. Could you please share whether this is the same output you’re getting at your end or is it different?
We’re sorry for the inconvenience and looking forward to help you out. Regards,
If you study the code, when calculated, the coordinates of the image (roughly) are:
lowerLeftX = 139
lowerLeftY = 730
upperRightX = 456
upperRightY = 812
If you compare these coordinates to the position of the image in the output you’ve attached, you’ll understand that the image is not positioned correctly… Moreover, if you resize the provided dummy image to about 40-45% of it’s size before running the code (in software like Photoshop or something), the image will be positioned correctly. However this is not acceptable, because resizing the image causes it to lose quality.
I have logged the ‘cropped image’ issue as PDFKITNET-23946 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once it is resolved. However, I couldn’t notice any border around the image after printing it with the latest version 5.2.0. Please try the latest version at your end and see if it helps in this case.