Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Encrypt Function fails when page no excceds 7
  FAQ FAQ  Forum Search   Register Register  Login Login

Encrypt Function fails when page no excceds 7

 Post Reply Post Reply
Author
Message
sangeeth View Drop Down
Beginner
Beginner
Avatar

Joined: 03 Mar 12
Location: EKM
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sangeeth Quote  Post ReplyReply Direct Link To This Post Topic: Encrypt Function fails when page no excceds 7
    Posted: 03 Mar 12 at 6:31AM
Hi,
 
I am using  QUICK PDF Version 0723 (DELPHI) and in that I can successfully encrypt the file with
function EncodePermissions(1,0,0,0,0,0,0,0) and it successfully works if number of pages
less than or equal to 7.  The function fails and I got a blank page when the number of page
exceeds 7.
 
I even tried the trail version 0813 of Quick PDF and got the same problem.
 
 Could any one please help me.
 
Thanks.
Sangeeth
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 03 Mar 12 at 10:17AM
Hi Sangeeth!

Do you believe this by yourself???
Keep in mind that there are a lot of QuickPDF-users out there
and encrypt and decrypt is not a seldom used function.
Often here are users talking about 1000 and more pages.
You're completely on the wrong way with your prob.
The question should be:
Do you have this prob with only one pdf or with each pdf?
What about deleting page 8 and try to encrypt the pdf then?
Perhaps on page 8 there's a special new technic not support by QuickPDF yet?
Think here are few guys helping you out if you're able to upload the problem-pdf anywhere.
Posting your code (the relevant part) could be helpful, too.

Cheers and welcome here,
Ingo

Back to Top
sangeeth View Drop Down
Beginner
Beginner
Avatar

Joined: 03 Mar 12
Location: EKM
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sangeeth Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 12 at 5:43AM
Hi Ingo,
 
Thank you for the quick response.
 
I will post sample code here please let me know if I am in the wrong way.
 
Var  pdflb : Tquickpdf0723;
EncPerm,unloackresult : integer;
begin
   pdflb          := Tquickpdf0723.Create;
   unloackresult  := pdflb.UnlockKey(//key); //license key orginal
   pdflb.LoadFromFile('D:\testquickpdfissue.pdf');
   EncPerm:=pdflb.EncodePermissions(1,0,0,0,0,0,0,0);
   pdflb.Encrypt('locked_down','',1,EncPerm);
   pdflb.SaveToFile('D:\quickpdfencrypted.pdf');
 
Is there any option to attach the sample file which failed to encrypt so that I can attach for reference.
I tried to encrypt few pdf files from the net and there is some issue for encrypt with some files.
 
Thanks,
Sangeeth
 
 
 
 
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 12 at 11:12AM
Hi!
 
You can't see anything wrong from this code-snippet.
What could be is:
If the loaded files are encrypted your new encryption won't work.
First you have to check if the files are encrypted and if "yes" you
have to decrypt them and then you can create a new encryption.
You understand? ...you can't create a new encryption on a file
where's already an encryption with a main password ;-)
This could be a possible reason for your probs.
 
Cheers, Ingo
 
Back to Top
sangeeth View Drop Down
Beginner
Beginner
Avatar

Joined: 03 Mar 12
Location: EKM
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sangeeth Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 12 at 11:30AM
Hi Ingo,
 
Thanks for the reply.
 
But the file testquickpdfissue.pdf is created by converting a text file for testing purpose and there
is no encryption applied for it.
 
only thing I noted that in the text file if the file is less than 70KB (Approx) the LoadFromFile works without any issue and also encrypted without any issue.
 
When I added few more lines to the testquickpdfissue.pdf it failed to encrypt the file. If I remove the
extra added lines the encryption works again without any issue.
 
If there is any option here to attach the files you may be able to check.
 
Thanks,
Sangeeth
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 06 Mar 12 at 8:10AM
Hi!
 
You can't upload a testfile 'cause
it's only a user-user-forum here.
There are many free filehoster on the net
doing this service for you for free ;-)
You can use the official support-pages
there's an upload-option, too. There
your prob would be managed by the official
publishers of the library.
 
Cheers, Ingo
 
Back to Top
sangeeth View Drop Down
Beginner
Beginner
Avatar

Joined: 03 Mar 12
Location: EKM
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sangeeth Quote  Post ReplyReply Direct Link To This Post Posted: 06 Mar 12 at 8:56AM
Hi Ingo,
 
Thank you for the information.
 
I will try the Technical support.
 
Thanks,
Sangeeth
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 06 Mar 12 at 11:13AM

QP.LoadFromFile is returning 0 which means the file is most likely corrupted / malformed.

Andrew.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store