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 - SecurityInfo
  FAQ FAQ  Forum Search   Register Register  Login Login

SecurityInfo

 Post Reply Post Reply
Author
Message
mdgodfrey View Drop Down
Team Player
Team Player


Joined: 09 Jul 13
Location: Utah
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdgodfrey Quote  Post ReplyReply Direct Link To This Post Topic: SecurityInfo
    Posted: 19 Mar 16 at 12:30AM
I am trying to discover if a PDF has a password or not before attempting to decrypt it.
I have tried using SecurityInfo(1) and SecurityInfo(2) which checks for Master and User respectively. At least according to the documentation I have.

They both just seem to just want to return 2 which is 'No'.
I know the file has a password because I can decrypt it using the password.

So I am not sure what I am missing. Any help, please?
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 19 Mar 16 at 9:17AM
How did you open in QPDF it if it had a password?   You can simply call DAOpenFileReadOnly with an empty password.  If the file has a password you should get a zero result and the last error code should be 404.  But it depends what type of functionality the password you are checking for would be protecting.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 19 Mar 16 at 3:31PM
Up to the 7.xx-versions of QuickPDF you could use SecurityInfo after LoadFromFile to check for user- and masterpassword.
Debenu decided then to be completely legal to the pdf-specs.
This means that a user-password should prevent for looking into a pdf-document.
So the LoadFromFile won't work proper if the pdf-document has a user-password.
The main-password isn't a problem - SecurityInfo will check this in a proper way.
If you want to load a pdf-document with a user-password, after LoadFromFile it's always necessary now to use LastErrorCode.
The last error code 404 shows you that there's a user password.
I've comunicated about this issue with Debenu in the past.

Cheers,
Ingo

Back to Top
mdgodfrey View Drop Down
Team Player
Team Player


Joined: 09 Jul 13
Location: Utah
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdgodfrey Quote  Post ReplyReply Direct Link To This Post Posted: 20 Mar 16 at 12:11AM
That's the answer I needed.

Thanks much
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