How to identify pdf is password protected?
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
How to identify pdf is password protected?
Hello,
How to identify the pdf file is password protected? any property for that?
How to identify the pdf file is password protected? any property for that?
-
- Site Admin
- Posts: 6815
- Joined: Mon Oct 15, 2012 9:21 pm
- Location: London, UK
Re: How to identify pdf is password protected?
Hi Vivek,
Thanks for the post - You have posted in the End User Editor forum. Are you looking to do this programmatically via the SDK, or did you mean to post in the End User forums?
Thanks,
Thanks for the post - You have posted in the End User Editor forum. Are you looking to do this programmatically via the SDK, or did you mean to post in the End User forums?
Thanks,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to identify pdf is password protected?
Hello,
yes, pragmatically with SDK.
yes, pragmatically with SDK.
-
- Site Admin
- Posts: 6815
- Joined: Mon Oct 15, 2012 9:21 pm
- Location: London, UK
Re: How to identify pdf is password protected?
Hi Vivek,
I've moved your post to the appropriate forum and will forward this on for further comment.
Thanks,
I've moved your post to the appropriate forum and will forward this on for further comment.
Thanks,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: How to identify pdf is password protected?
Hello vivekpatel,
Please provide a better explanation for such a questions so that we can advice further.
1) Is the document already opened or is it a file on disk that you want to open?
2) What do you need this for exactly?
3) Do you need to check whether the password itself is present or just check some security permissions?
Cheers,
Alex
Please provide a better explanation for such a questions so that we can advice further.
1) Is the document already opened or is it a file on disk that you want to open?
2) What do you need this for exactly?
3) Do you need to check whether the password itself is present or just check some security permissions?
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to identify pdf is password protected?
Hello,
I have password protected file, i open this file in pdf tracker and it shows passsword window.
How to detect file is password protected or not before open to edit?
i want to check this programmatically in vb.net.
I have password protected file, i open this file in pdf tracker and it shows passsword window.
How to detect file is password protected or not before open to edit?
i want to check this programmatically in vb.net.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: How to identify pdf is password protected?
This code should help:
Cheers,
Alex
Code: Select all
public class AuthCallback : PDFXEdit.IPXC_DocAuthCallback
{
public void AuthDoc(PDFXEdit.IPXC_Document pDoc, uint nFlags)
{
//If this method is called then the document is protected
}
}
private void checkForPasswordToolStripMenuItem_Click(object sender, EventArgs e)
{
AuthCallback clbk = new AuthCallback();
pxcInst.OpenDocumentFromFile(@"D:\Test.pdf", clbk);
}
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to identify pdf is password protected?
Hello,
It is possible to identify that the document is password protected using "PDF Core Enumerations " ---> https://sdkhelp.pdf-xchange.com/vie ... umerations
Thanks.
It is possible to identify that the document is password protected using "PDF Core Enumerations " ---> https://sdkhelp.pdf-xchange.com/vie ... umerations
Thanks.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: How to identify pdf is password protected?
Hello vivekpatel,
No, that is not possible. For the solution, check my previous reply.
Cheers,
Alex
No, that is not possible. For the solution, check my previous reply.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: How to identify pdf is password protected?
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 43
- Joined: Fri Jun 24, 2022 8:15 am
Re: How to identify pdf is password protected?
HI,Sasha - Tracker Dev Team wrote: ↑Thu Oct 20, 2016 2:33 pm This code should help:Cheers,Code: Select all
public class AuthCallback : PDFXEdit.IPXC_DocAuthCallback { public void AuthDoc(PDFXEdit.IPXC_Document pDoc, uint nFlags) { //If this method is called then the document is protected } } private void checkForPasswordToolStripMenuItem_Click(object sender, EventArgs e) { AuthCallback clbk = new AuthCallback(); pxcInst.OpenDocumentFromFile(@"D:\Test.pdf", clbk); }
Alex
I am developing application using c# and I cant find respective method in c#. So could you let me know how can i do this check in c#?
-
- Site Admin
- Posts: 17949
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: How to identify pdf is password protected?
Hello prasantha,
Are you using the Viewer or Editor SDK?
The above discussed methods are from the Editor SDK - and they should be available irrespective of the programming language you use.
You might need to modify the above code to implement it in your own project, but that should be pretty straight forward for the above discussed methods.
Kind regards,
Stefan
Are you using the Viewer or Editor SDK?
The above discussed methods are from the Editor SDK - and they should be available irrespective of the programming language you use.
You might need to modify the above code to implement it in your own project, but that should be pretty straight forward for the above discussed methods.
Kind regards,
Stefan
-
- User
- Posts: 43
- Joined: Fri Jun 24, 2022 8:15 am
Re: How to identify pdf is password protected?
Thank you for your response.
I am refering to the editor SDK. But I cant see the respetive method in c#.
Below are the available methods related to open file. So i cant see a method to pass a callhback function or return value.
I am refering to the editor SDK. But I cant see the respetive method in c#.
Below are the available methods related to open file. So i cant see a method to pass a callhback function or return value.
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 17949
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: How to identify pdf is password protected?
Hello prasantha,
Ahh - I thought you are having problems with the IPXC_DocAuthCallback
The posts above yours are 5+ years old - so it seems like OpenDocFromFile has been changed to OpenDocFromPath. Please use the open from path method instead and all should be well:
https://sdkhelp.pdf-xchange.com/vi ... ocFromPath
Kind regards,
Stefan
Ahh - I thought you are having problems with the IPXC_DocAuthCallback
The posts above yours are 5+ years old - so it seems like OpenDocFromFile has been changed to OpenDocFromPath. Please use the open from path method instead and all should be well:
https://sdkhelp.pdf-xchange.com/vi ... ocFromPath
Kind regards,
Stefan
-
- User
- Posts: 43
- Joined: Fri Jun 24, 2022 8:15 am
Re: How to identify pdf is password protected?
So using above method, I cant check whether the documetn is password protected or not. Is there any other open method which return whether the document is password protected or not? Becuase currently I have used seperate methods to check whether the documetn is password protected and then another method to open the file. it hurts the performance of the large file opening. So i m looking for a method that both check and open can be done in a single call.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: How to identify pdf is password protected?
Hi,
Do you need to open a document as PXC or PXV document?
You can use op.openDoc with "NoAuth = true" to get the PXCDocument. If that operation throws an exception and if the exception is "HResult($FFFFFFFF82141008)" - the document is password protected.
p.s.
unchecked((int)0x82141008)
-žarko
Do you need to open a document as PXC or PXV document?
You can use op.openDoc with "NoAuth = true" to get the PXCDocument. If that operation throws an exception and if the exception is "HResult($FFFFFFFF82141008)" - the document is password protected.
p.s.
unchecked((int)0x82141008)
-žarko
-
- Site Admin
- Posts: 8613
- Joined: Wed Jan 03, 2018 6:52 pm
How to identify pdf is password protected?
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com