Print Page | Close Window

Cannot open secured PDF

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3545
Printed Date: 25 Apr 24 at 2:18AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Cannot open secured PDF
Posted By: Soruk
Subject: Cannot open secured PDF
Date Posted: 08 Feb 18 at 3:04PM
Hello,

I have a several secured / protected PDF files, and I'm not able to open theses files using C# wrapper and the following methods:
  • DAOpenFileReadOnly
  • DAOpenFile
  • LoadFromFile

I do not know the password and therefore to these functions the password is set to "".
And I got the following code error: 404 - INVALID_PASSWORD_CODE_ERRORS.

I do not understand why Debenu PDF cannot open these files, although Google Chrome, Edge and other PDF Readers (PDF X-Change Viewer, Windows 10 Reader) do not have any problem with opening theses files.

Why your library cannot open these files (I'm using the letest version).

Regards



Replies:
Posted By: Ingo
Date Posted: 08 Feb 18 at 6:37PM
Hi Soruk,

there are two types of passwords:
1. The user password (you have toinsert it while opening the pdf in a reader).
2. The -not very safe- main password to protect some settings inside the pdf.
I think you're talking about this main password.
Using the LoadFromFile you have to insert the password as unicode string. I think that this is your problem...
After the load you should check if there's an existing encryption (if there's a password then there's an encryption, too). If so you should call the decrypt-function.

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: Soruk
Date Posted: 08 Feb 18 at 8:38PM
Hi Ingo,

Thanks for your message. 
I think, these are the second types PDF files. 
But how I can insert the password in the “LoadFromFile” funthion that I do not know (actually I set the empty string). 
Other PDF viewers do not ask for the password when opening file. 

Regards,
Soruk


Posted By: Ingo
Date Posted: 10 Feb 18 at 12:28PM
like i've written...
NOT a string ;-)




-------------
Cheers,
Ingo



Posted By: Soruk
Date Posted: 20 Feb 18 at 12:46PM
Hello Ingo,

I'am using the official Debenu C# wrapper and its fails probably when marshaling the empty string to the C++ DLL.
This kind of PDFs does not work in the Demo application.
I can send you an example of the PDF in private massage or e-mail.

Regards,
Soruk


Posted By: Ingo
Date Posted: 20 Feb 18 at 5:44PM
Hi Soruk,

you can send the pdf to webmaster *at* pdf-analyzer *dot* com
Please keep in mind that this is a forum mainly for users...
Not the official support page of the publishers.





-------------
Cheers,
Ingo



Posted By: Ingo
Date Posted: 21 Feb 18 at 10:40PM
Hi,


i've got your mail...
Foxit and Adobe products can open your pdf-files. Please keep in mind that their installations are many, many mb large ;-)
On the other side there's the slim line QuickPDF library...
You know what i wanna tell... ;-)

I've made the same experiences as you did already.
My apps are telling me that there is a main- AND a user-password. That's not true cause Foxit and the Adobe Reader are able to open the pdfs without asking for a password.

If i look inside the pdf-source using Notepad i see some strange objects and constructs...
Using online validators i've got the following two messages:
1. The document doesn't conform to the PDF reference (missing required entries, wrong value types, etc.).
2. Message: Error, cannot read PDF file: Unexpected escaped string.
The other online tools raise similar messages...

My advice:
Send the documents to the official support team.
Perhaps they are able to fix this problem to make QuickPDF showing these malformed pdf-documents.





-------------
Cheers,
Ingo



Posted By: Soruk
Date Posted: 22 Feb 18 at 7:07AM

Hi Ingo,

Thanks for your e-mail.

I just contacted Debenu and I hope they will fix this issue soon.

Regards,

Soruk



Posted By: Ingo
Date Posted: 23 Feb 18 at 11:42AM
please keep in mind:
These pdf-documents are malformed not always according to the pdf-specs.
A 100 mb installation of an acrobat reader can fix this on the fly - a fast but slim line QuickPDF library not always ;-)



-------------
Cheers,
Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk