Free Support Forum - aspose.com

Aspose.Pdf.Kit.PdfFileStamp Exception in .NET for assembly version 1.9.0.0

I am getting (suddenly) an exception when attempting to add a watermark to a PDF.

The exception text is:

A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in aspose.pdf.kit.dll. Additional information: Specified argument was out of the range of valid values.

This occurs when the following code executes:

Dim stamper As Aspose.Pdf.Kit.PdfFileStamp

Dim fileName As String = "a valid PDF path on local or network drive"

stamper = New Aspose.Pdf.Kit.PdfFileStamp(fileName, fileName & "_temp") ' ERROR HERE

Why does this occurs and how do I remedy it? I have uninstalled and reinstalled the toolkit after deleting all occurences of the Aspose.Pdf.Kit.dll. The code that applies the run time license is unchanged and does execute.

Hello kevin,

Thanks for considering Aspose.

I have tested the code but I am not able to re-generate the exception. Can you please explain the scenario little more. Make sure the path for filename is valid network path.

I have noticed that a 'FileInfo' object on the filename being used seems to cause a "file in use by another process" exception, which you can only see by turning exception trapping off first for ArgumentOutOfRangeException.

I removed the use of "FileInfo" and turned off exception handling and I can now get past "New Aspose.Pdf.Kit.PdfFileStamp".

Hi,

Can you please try the latest version of Aspose.Pdf.Kit?