Hi,
I'm having problem using PXCp_CheckPassword function in VB.NET. Every time i use the function it returns a long numeric value. Sample code from your website https://help.pdf-xchange.com/DEV/de ... ckpassword says that return value should be 1 (for user password) or 2 (for owner password).
I attached a sample code and a pdf. The pdf password is "password".
Any help is appreciated.
How to check owner password using PXCp_CheckPassword
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
-
- User
- Posts: 518
- Joined: Thu Dec 06, 2007 8:13 pm
How to check owner password using PXCp_CheckPassword
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 3556
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: How to check owner password using PXCp_CheckPassword
The problem is with how you declare and use PXCp_CheckPassword function.
Correct declaration for VB.NET is:
Please note, there is also Unicode version of that function
Now, your CheckPassword will be a bit more simple:
HTH
Correct declaration for VB.NET is:
Code: Select all
<DllImport("xcpro40")> Public Shared Function PXCp_CheckPassword(ByVal pObject As Integer, <MarshalAs(UnmanagedType.LPStr)> ByVal pPassword As String, ByVal PassLen As Integer) As Integer
End Function
Code: Select all
<DllImport("xcpro40")> Public Shared Function PXCp_CheckPasswordW(ByVal pObject As Integer, <MarshalAs(UnmanagedType.LPWStr)> ByVal pPassword As String, ByVal PassLen As Integer) As Integer
End Function
Code: Select all
Public Function CheckPDFPassword(ByVal sPassword As String) As Integer
Dim pass_len As Integer
pass_len = Len(sPassword)
CheckPDFPassword = XCPro40_Defs.PXCp_CheckPassword(nSelectedDocument, sPassword, pass_len)
End Function
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 518
- Joined: Thu Dec 06, 2007 8:13 pm
Re: How to check owner password using PXCp_CheckPassword
That works. Thank you.
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London