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

Free Support Forum - aspose.com

ArgumentOutOfRangeException in ctor PdfFileStamp

Dear support

I am getting an ArgumentOutOfRangeException when calling

Aspose.Pdf.Kit.PdfFileStamp stamper =
new Aspose.Pdf.Kit.PdfFileStamp(
tempFilePath );

With the following stack trace:

System.ArgumentOutOfRangeException occurred
Message=“Das angegebene Argument liegt außerhalb des gültigen Wertebereichs.”
bei xb588f351bb5f458f.x9ffd17ff675cf640.x4785b9e8373ed5c6.xab05c62a2a183f47(Char[] x2724c2f362cdd798)

The pdfInputFilePath has a value of “C:\Users\ukeim\Documents\Visual Studio 2008\Projects\NIC pdf2flow\Etc\TestEnvironment\Temp\2008-5-16_18-27-28_dfack.pdf” (existing file!)

The tempFilePath has a value of “C:\Users\ukeim\AppData\Local\Temp\a4be12a7-791b-4436-a286-1b06336d3bd8.pdf” (non-existing file in existing folder)

I attached the original file.

Question: Could you tell me what I am doing wrong here? (The code did work in the past…)



Thank you for considering Aspose.

I am not able to reproduce the error. I test it with following code(in both version 3.0 and 3.1, and the output file attached)

Stamp stamp = new Stamp();
stamp.BindLogo(new FormattedText("Test PdfFileStamp"));

string In_Path = @"C:\Users\ukeim\Documents\Visual Studio 2008\Projects\NIC pdf2flow\Etc\TestEnvironment\Temp\";
string Out_Path = @"C:\Users\ukeim\AppData\Local\Temp\";
PdfFileStamp fileStamp = new PdfFileStamp(In_Path+"2008-5-16_18-27-28_dfack.pdf",Out_Path+"a4be12a7-791b-4436-a286-1b06336d3bd8.pdf");


Thank you.

I am using Windows Vista, German version. I’ll try another OS.



I tested it in Windows Vista and I could not reproduce this error. I used Visual Studio 2005 but not 2008.

does the stack trace tell anything about what aspose.pdf.kit does complain?

We can't find any useful information form the stack trace. I tested this issue under Visual Studio 2008 and it worked well. Please make sure you are refering to the correct dll. You'd better create new project or test it on other machine.

Just figured out:

The exception, as described in the initial posting, only does occur when running the application from inside the debugger.

No matter whether I compile it as debug or release version, the exception occurs.

In contrast, if I am running the application directly (it is a console application), it performs correct (again debug and release version).

Question: Is this information of any value to you? Can you provide me with a workaround?


Hi Uwe,

Since it works when you run the application directly, I think that is a internal exception which has been caught and processed. Can you please tell me how to set the debugger to reproduce this error?

OMG! I did the most stupid beginner’s error ever!

I set the debugger to stop on exceptions, even if being caught.

Naturally, when configuring exceptions in the debugger correctly, the code runs totally smooth.

Shame on me, I am really sorry for bothering you with such a stupid question! I must have been blind!

Thanks again for your patience!

Best regards