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

Free Support Forum - aspose.com

Error while Converting the PDF document

Hi,

We are getting following error message when we are trying to convert attached PDF document to PDF using ASPOSE.

Please let us know the issue releated this problem.

Error Message:
Type : System.SystemException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Illegal filter Mode.
Source : Aspose.Pdf.Kit
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : SByte[] xb9fd793f310cc289(xeb116a323308e2f7.x3cb3e02ca07b8735, xeb116a323308e2f7.x847acb1842aef4c9)
Stack Trace : at xeb116a323308e2f7.x7759a935a2782a02.xb9fd793f310cc289(x3cb3e02ca07b8735 xcf18e5243f8d5fd3, x847acb1842aef4c9 xb44380e048627945)
at xeb116a323308e2f7.x7759a935a2782a02.xb9fd793f310cc289(x3cb3e02ca07b8735 xcf18e5243f8d5fd3)
at xeb116a323308e2f7.xe923a3ea50a7237f.xeb1688f3c25edfc6(x1ac4f595ab61cbe1 x4b18414d8aa2b78b)
at xeb116a323308e2f7.x3233d061fc77cddd.close()
at Aspose.Pdf.Kit.PdfFileStamp.Close()

Thanks,
-Balaji

Hi Balaji,

Thank you for considering Aspose.

Do you mean you want to convert PDF to image? I can't reproduce this error. Can you please provide your code and let us check it?

We are trying to apply watermark using Aspose.PDFKit to the existing PDF and it fails.

Can you please provide the code and let us check it?

Please see below code snippet which we are using add the watermark using ASPOSE PDF KIT.

//pass source file and destination file
PdfFileStamp pdfFileStampWatermark = new PdfFileStamp(sourceFilePath, destinationFilePath);

Stamp logostamp = new Stamp();

logostamp.BindLogo(new FormattedText(watermarkText, System.Drawing.Color.FromArgb(180, 0, 0), FontStyle.TimesItalic, EncodingType.Winansi, false, textWidth));

logostamp.Rotation = rotationAngle;
logostamp.Opacity = 1f;
logostamp.SetOrigin(200, 350);
pdfFileStampWatermark.AddStamp(logostamp);
pdfFileStampWatermark.Close();

Thanks,
Balaji

Hi Balaji,

We've checked the attached Pdf file and found it had been secured . In general, you need to know the password to decrypt the file. For more details to encrypt&decrypt Pdf files, please refer to Implementing Security.

For the attached file, since it is only encrypted by a user password, we could decrypted it by the owner password(should be blank) as following:

PdfFileSecurity security = new PdfFileSecurity(sourceFilePath,decryptedFilePath);
security.DecryptFile("");

PdfFileStamp pdfFileStampWatermark = new PdfFileStamp(decryptedFilePath, destinationFilePath);

......

Thanks,