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

Passwort Check

 Post Reply Post Reply
Author
Message
luet View Drop Down
Team Player
Team Player
Avatar

Joined: 09 Aug 16
Location: Germany
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote luet Quote  Post ReplyReply Direct Link To This Post Topic: Passwort Check
    Posted: 16 Aug 16 at 12:46PM
How can I check whether a password must be specified before opening a PDF file?
To open a protected PDF file so I need a Paswort how do I know that before opening QPdf.LoadFromFile?

Thank you for a few lines of code
luet
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: 16 Aug 16 at 2:32PM
I have found it simplest and quickest to open the file and see if it fails with "invalid password" (404).  If you use DAopenfilereadonly it should be very quick because it does not have to read the whole file.  You can close it if it is successful and then re-open the file with LoadFromFile if you prefer this.
Back to Top
luet View Drop Down
Team Player
Team Player
Avatar

Joined: 09 Aug 16
Location: Germany
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote luet Quote  Post ReplyReply Direct Link To This Post Posted: 16 Aug 16 at 2:47PM
thank for answer.
is there no other possibility?
There's a CheckPassword method ...
Or do I have previously also run only LoadFromFile?

Thank you for a few lines of code
luet
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: 16 Aug 16 at 5:38PM
Hi Luet,

the functionality offered by Debenu isn't completely straight.
LoadFromFile should be the first...
LastErrorCode should be the second (to check code 404 = password error).
GetAnalysisInfo (for detecting a mainpassword) should be the last.

Loading a pdf with QuickPDF always works, even if you don't know the main password (an empty string is enough). So having a file with an unknown main password you can load it and use GetAnalyseInfo to check for a main password.
If there's a user password even LoadFromFile (and all similar functions) fails. So there's no possibility to check if a user password is set even if GetAnalysisInfo offers these option ;-)
In this case (existing user password) you can only use LastErrorCode and check for result 404.

Cheers,
Ingo

Back to Top
luet View Drop Down
Team Player
Team Player
Avatar

Joined: 09 Aug 16
Location: Germany
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote luet Quote  Post ReplyReply Direct Link To This Post Posted: 16 Aug 16 at 8:58PM
thanks for good help.

It is fun with Quick PDF to work, but I need more time to understand anything.
Working only one week so ...

It's nice that you help so much :-)
thank you very much
luet
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: 16 Aug 16 at 9:05PM
You should really read the developer guide - many samples and much help ;-)

Cheers,
Ingo

Back to Top
luet View Drop Down
Team Player
Team Player
Avatar

Joined: 09 Aug 16
Location: Germany
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote luet Quote  Post ReplyReply Direct Link To This Post Posted: 16 Aug 16 at 9:35PM
I've already done that, but everything is a characterized also not clear.
It lacks a few other examples.
Although it is already a good start.

I also study the reference

thank you
luet
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