Print Page | Close Window

Append Pages from unsecured to secured pdf

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=1950
Printed Date: 22 Nov 24 at 7:06PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Append Pages from unsecured to secured pdf
Posted By: amitsri
Subject: Append Pages from unsecured to secured pdf
Date Posted: 12 Sep 11 at 6:19AM
Hi,

I need to append pages from one unsecured PDF to another secured PDF and want to keep all the source secured PDF's restrictions with password as it is. Please suggest me any sample code to achieve the goal. In addition, i have only open password to read the secured PDF. For further explanation, see below.

Source1 + Source2 = New

Secured PDF + Unsecured PDF = New Secured PDF with all the Secured PDF Open and Restrictions.

Thanks



Replies:
Posted By: Rowan
Date Posted: 12 Sep 11 at 7:10AM
You will want to use these two functions:

GetEncryptionFingerprint
http://www.quickpdflibrary.com/help/quickpdf/GetEncryptionFingerprint.php - http://www.quickpdflibrary.com/help/quickpdf/GetEncryptionFingerprint.php

EncryptWithFingerprint
http://www.quickpdflibrary.com/help/quickpdf/EncryptWithFingerprint.php - http://www.quickpdflibrary.com/help/quickpdf/EncryptWithFingerprint.php

So basically the steps are:

1. Load secured PDF
2. Get encryption details using GetEncryptionFingerprint
3. Decrypt secured PDF
4. Merge PDFs
5. Apply old security onto new merged PDF using EncryptWithFingerprint
6. Save to disk


Posted By: amitsri
Date Posted: 12 Sep 11 at 7:11AM
Thanks, I'll try and let you know soon.


Posted By: amitsri
Date Posted: 12 Sep 11 at 7:35AM
Hi,

I have tried as you suggested, function GetEncryptionFingerprint() returns Nothing in VB.Net. FYI, i am using Quick PDF Library 7.21. My Code steps are as followings:

Step 1: SetAdvancePassword(<open password>)
Step 2: LoadFromFile(<Filepath>)
Step 3: GetEncryptionFingerprint()

As per the SetAdvancePassword(), If the password is correct, the file will be automatically decrypted.

Thanks,


Posted By: amitsri
Date Posted: 12 Sep 11 at 7:51AM
Hi,

I got the encrypt finger print using following steps :

Step 1: LoadFromFile(<FilePath>)
Step 2: SetPassword(<openpassword>)
Step 3: GetEncryptionFingerprint()

I think, using SetAdvancePassword() is preventing to get the encrypt finger print.

Thanks


Posted By: amitsri
Date Posted: 12 Sep 11 at 10:02AM
Thanks for the suggestions, I have successfully merged two documents as needed.



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