When I run the following code, I got IndexOutOfRangeException. I have attached the PDF file and image file, thanks.
Hi Caifang,
Hi Caifang,
Thanks for your inquiry. It seems you are using Aspose.Pdf without applying license file. Please note Aspose.Pdf evaluation version has two limitations, evaluation watermark and at most four elements of any collection can be viewed. If you already have a valid license file then please apply it otherwise please make a request for 30 days temporary license, it will resolve the issue.
Please feel free to contact us for any further assistance.
Thank you for your quick response.
Hi Caifang,
Thanks for your investigating this issue.
Hi Caifang,
Hi,
I’m facing the same issue with Aspose.PDF for .NET 17.9.0.0 Trial.
I’ve requested the 30 days trial license. Everything works great except the PDFFileStamp.
It seems that it doesn’t works well on files bigger than 2-3MB, the Close() method returns always a NullReferenceException. Is it a 30Days Trial limitation?
I’m following the examples found in your documentation.
Thanks for support,
Mario
@mario.ferrante,
Kindly send us your source PDF and code. We will investigate and share our findings with you.
Hi Imran,
thank you for your response.
The code is taken from your examples:
PdfFileStamp fileStamp = new PdfFileStamp();
fileStamp.BindPdf(inputPDFFile);
Aspose.Pdf.Facades.Stamp stamp = new Aspose.Pdf.Facades.Stamp();
stamp.BindImage(stampImageFile);
stamp.SetOrigin(x, y);
// Add stamp to PDF file
fileStamp.AddStamp(stamp);
// Save updated PDF file
fileStamp.Save(outputPDFFile);
// Close fileStamp
fileStamp.Close(); <-- Here I obtain a NullReferenceException
You can try to use any PDF file bigger than 3MB.
Should I use an ImageStamp instance instead of PDFFileStamp?
Regards,
Mario
Thanks for sharing sample code snippet.
Please note that, in order to test the scenario and try to observe the same issue, we need a sample PDF document, with which you are experiencing it. We will really appreciate if you can please share a sample PDF document, so that we can test the scenario in our environment and address it accordingly.
We always recommend to use new Aspose.Pdf DOM approach in order to implement API features. Please check “Adding Image Stamp” article in our API documentation and try it on your side. In case your still face any issue please let us know.