Print Page | Close Window

Conversion from 7.26 to 8.15

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2264
Printed Date: 13 Aug 25 at 5:25PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Conversion from 7.26 to 8.15
Posted By: Luke
Subject: Conversion from 7.26 to 8.15
Date Posted: 15 May 12 at 12:35AM
I am converting from 7.26 to 8.15 using Delphi 2007. My code is to allow open but only allow printing. So I had two constants defined:
  OWNER_PASSWORD = 'test owner password';
  USER_PASSWORD = '';
and the following code:
var
  iPermissions: integer;
  iResult: integer;
begin
  iPermissions := FPDF.EncodePermissions( 1,     // Yes - CanPrint
                                                  0,     // No  - CanCopy
                                                  0,     // No  - CanChange
                                                  0,     // No  - CanAddNotes
                                                  0,     // No  - CanFillFields
                                                  0,     // No  - CanCopyAccess
                                                  0,     // No  - CanAssemble
                                                  1 );   // Yes - CanPrintFull
  iResult := FPDF.Encrypt( OWNER_PASSWORD, USER_PASSWORD, 2, iPermissions );
  FPDF.SaveToFile( 'test.pdf' );
end;

That code works with 7.26. However under 8.15 I am unable to open the saved file with Acrobat Reader, even with the password. I checked the return codes of each function and no errors were reported. However, if I change the Encrypt function to use 256 AES Encryption, i.e.
  FPDF.Encrypt( OWNER_PASSWORD, USER_PASSWORD, 3, iPermissions );
everything is fine. I can open the file without password and I am only able to print.

Luke



-------------
Luke M. Miller

ResCorSoft, Inc.



Replies:
Posted By: Wheeley
Date Posted: 15 May 12 at 3:03AM
It's looks like 8.16 beta 1 might have fixed it. Reviewing the change log it says that made a change to 128-bit AES encryption. I would try that version and see if your issue goes away.

Wheeley


Posted By: Luke
Date Posted: 15 May 12 at 3:33AM
Thanks. Working on code that will go into production later this week. Would rather not use beta code. Easier just to use 256-bit encryption. Everyone should have upgraded to Acrobat 9 anyway.

-------------
Luke M. Miller

ResCorSoft, Inc.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk