I found some sample pages: https://help.pdf-xchange.com/DEV/de ... ckpassword
but everything I try to use the function it returns an error code indicating incorrect password. Even if I take a brand new PDF, and using the X-Change Viewer add a password to open such as "123456", I can then open it in X-Change viewer by typing that password, but I cannot open it via code by sending that password into the above function.
I'm sure it has something to do with my point conversion since I am using C#, but I can't tell what it is. The pointer seems correct to me when I debug and print/display.
"password" comes in as a string
PDFObject is a valid pointer to the PDF object
Code: Select all
byte[] bytePassword = System.Text.UnicodeEncoding.Unicode.GetBytes(password);
int passwordLength = bytePassword.Length;
fixed (byte* passPointer = bytePassword)
{
this.result = XCPro35_Defs.PXCp_CheckPassword(this.pdfObject, ref *passPointer, passwordLength);
}