We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unable to insert a image into existing PDF


I used code snippet posted on above URL. I am getting reference error. Please see image for details.
I think its just because of version issues. I am using Aspose.PDF version 4.1, Aspose.Word 8.0.
Please help me. All I need is to insert a image into PDF or PDF form on a given page and place.

I tried
" public bool AddImage(Stream imageStream, int pageNum, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY);"
this method which is giving error
"at Aspose.Pdf.Kit.PdfFileMend.AddImage(Stream imageStream, Int32 pageNum, Single lowerLeftX, Single lowerLeftY, Single upperRightX, Single upperRightY) at ".

Hi Sudheer,

Thanks for contacting support.

Please note that Document class was introduced in Aspose.Pdf for .NET since version 6.0.0 which was released in July-2011. As per my observations, you are using an older release version 4.1.0 so I am afraid you might not be able to use Document class or other features which were introduced in MergedAPI release (starting from v6.0.0). Can you please try using the latest release version of Aspose.Pdf for .NET 7.7.0 and in case you still face the same issue, please feel free to contact.

We are sorry for this inconvenience.


I am trying to insert a image into PDF using Aspose.Pdf.Kit.PdfFileMend.AddImage. I have image of jep with dimensions 438x278. I am unable to find right co-ordinates for this image. I tried a lot of co-ordinates to insert image . The Image is always stretched never in right size on a PDF. Can you please help me in find right co-ordinates. I just want to know how to we find out Lowerx,LowerY,UpperX,UpperY for a image when we know height n Width .

Thank you.

Hi Sudheer,

I am working over this query and will get back to you soon.

Thank You. I am waiting for your reply. Please post here ASA you have it.

Hi Sudheer,

During my initial testing, I am afraid I could not find any mechanism on determining the Lowerx,LowerY,UpperX,UpperY for a image when we know height and Width. However for the sake of investigation, I have logged it as PDFNEWNET-33956 in our issue tracking system. As soon as we have some updates, we would be more than happy to update you with the status of correction. Please be patient and spare us little time.