EncryptFile clears ViewerPreferences

A file is set to with ViewerPreference.PageModeUseNone, after encrypting all viewer preferences are not retained.

====CODE=====

var License = new Aspose.Pdf.Kit.License();

License.SetLicense("Aspose.Pdf.Kit.lic");
string inFile = @"e:\pdf\sample.pdf";
string outFile = @"e:\pdf\sample-out.pdf";
string encryptedFile = @"e:\pdf\sample-enc.pdf";

Aspose.Pdf.Kit.PdfContentEditor editor = new Aspose.Pdf.Kit.PdfContentEditor();
editor.BindPdf(inFile);

editor.ChangeViewerPreference(ViewerPreference.PageModeUseNone);
editor.Save(outFile);

var pdfSecurity = new Aspose.Pdf.Kit.PdfFileSecurity(outFile, encryptedFile);

var docSecurity = Aspose.Pdf.Kit.DocumentPrivilege.ForbidAll;

docSecurity.AllowPrint = true;

docSecurity.PrintAllowLevel = 2;

pdfSecurity.EncryptFile("", "123456789", docSecurity, true);

Hi Nou,

We’re looking into this issue at our end and you’ll be updated the earliest possible.

We’re sorry for the inconvenience.
Regards,

Hi Nou,

I have reproduced this problem at my end and logged it as PDFKITNET-15107 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once the issue is resolved.

We’re sorry for the inconvenience.
Regards,

Hi Nou,


A hotfix that addresses this issue (in addition to PDFKITNET-14986) is expected to be available on Friday, 19th.

Dear Nou,


Please try the attached hotfix and let us know how it worked for you. Please also note that we still recommend using official release to be published in late March/early April.

Hi,

Looks good on my local, I will put this in our QA environment for further test. Can you confirm this also includes a fix for PDFKITNET-14986.

Thanks,
Nou

Hello,


Yes, the 4.2.0.2 includes also PDFKITNET-14986 (just note that 14986 is a more generic issue; part of the issue has been fixed in the attached hotfix, but we suspect that for other documents it may still have problems, so it’s not formally closed yet).

Hi,

Thank you for the hotfix, I can confirm that it does resolve the view preference but it does not resolve 14986 which is more critical for us.

FillImageField now places two image on page 2, one correctly on the field name, the other randomly in the middle of page 2 (line 6). The matching field name on page 3 is left blank.

This issue urgent, we need to get this resolved as soon as possible. Please let me know as soon as you can.

Thank you,
Nou

====code====

var License = new Aspose.Pdf.Kit.License();

License.SetLicense("Aspose.Pdf.Kit.lic");

var Form = new Aspose.Pdf.Kit.Form(@"E:\pdf\Simplified_DI_IL.pdf", @"e:\pdf\output1.pdf");

var Form2 = new Aspose.Pdf.Kit.Form(@"E:\pdf\Simplified_DI_IL.pdf", @"e:\pdf\output2.pdf");

Form.FillImageField("SIG_X_TPZ_PI_TopazSig", @"c:\coss\sig.png");

Form.FlattenAllFields();

Form.Save();

Form2.FillField("SIG_X_TPZ_PI_TopazSig", "Nou");

Form2.FlattenAllFields();

Form2.Save();

System.Diagnostics.Process.Start(@"e:\pdf\output1.pdf"); ;

System.Diagnostics.Process.Start(@"e:\pdf\output2.pdf"); ;

Hi Nou,

I have noticed this problem at my end. This is a different file than shared earlier, however I would like to inform you that as mentioned by Vitaly in his last post, this issue is still under progress; the issue was fixed for the particular case, but not generically. Currently, our team is working on this issue to resolve is for other cases as well. I have updated our team with this case. We’ll provide you the fix the earliest possible.

We’re sorry for the inconvenience.
Regards,

Hi Nou,


Thanks for sharing a different file. We have identified the cause of the issue in 2nd case and it is already fixed in the build we are working on.

The fix will be available in monthly release that is to be published either tomorrow or early next week.

The issues you have found earlier (filed as 14986) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(2)

The issues you have found earlier (filed as 15107) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.