Accessibility problems with password protected pdf files

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

aaronmcgranaghan
User
Posts: 15
Joined: Wed Oct 31, 2012 9:58 am

Accessibility problems with password protected pdf files

Post by aaronmcgranaghan »

Hello,

I work for a software company which produces assistive software to help people with visual impairments and disabilities. At the moment I am working on an application which uses the PDF-XChange Viewer control to open and display pdf files. Also, the application encompasses a screen reader which reads back the text on screen out loud to the user.

In unsecured pdf files, this works well as you would expect. However, when a document is password protected and has the property "Content Copying for Accessibility" set to "Allowed", I am unable to get the text required for the screen reader.

The application is being developed in C# and once the document has been opened and the password correctly entered, I attempt to get the text by using:

Code: Select all

pdfMain.DoVerb("Documents[#" + mDocId.ToString() + "].Pages[" + CurrentPageIndex().ToString() + "].Text", "Get", vDataInA, out vDataOut);
However, this returns the error 0x82132716, which means "No permissions for current action", and is preventing us from getting the text required for the screen reader.

Furthermore, a requirement of this application is to open and read pdf files that have been protected with a custom security handler implemented by a third-party company, ESDNow. We can successfully open and view these pdf files in our application, but as above, we cannot get the text.

I understand that for simple password protected pdf files we could use:

Code: Select all

DoDocumentVerb(docId, "", "RemoveSecurity", NULL, NULL, 0);
with the owner password to remove the security in order to get the text. However, with the pdf files that have been protected with a custom security handler, we have no means of acquiring the owner password for each pdf file.

Is there any way around this?
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Accessibility problems with password protected pdf files

Post by Stefan - PDF-XChange »

Hi Aaron McGranaghan,

I will need to discuss your question with my colleagues in the Canadian office, but could you in the mean time also provide us with a sample file showing this problem (and if possible a link to the end user decryption tool from ESDNow).

Best,
Stefan
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Accessibility problems with password protected pdf files

Post by John - Tracker Supp »

Hi,

You will appreciate the issue here is one of 'DRM' and author security integrity - as the access rights required for 'Read out Loud' to acquire the text is the same as it would be to actually copy the text and if this has been specifically excluded from the users access by the author it causes us a dilemma as we take Athors rights and DRM very seriously and would not want to in anyway compromise or be seen to be doing so.

However - we do obviously accept that your intended use is legitimate and would not violate the DRM etc or the authors intentions in any way - what we have to find is a compromise solution that would allow you access for the legitimate purpose intended - yet at the same time ensure the authors rights are also protected.

This is going to require a little time and thought to see if we can provide a solution - obviously this is only an issue for files protected in the manner outlined.

Your patience is therefore appreciated whilst we consider the options available ...
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
Tracker Support
http://www.tracker-software.com
aaronmcgranaghan
User
Posts: 15
Joined: Wed Oct 31, 2012 9:58 am

Re: Accessibility problems with password protected pdf files

Post by aaronmcgranaghan »

Thanks for the replies.

I have attached a sample pdf file that causes the permissions error.

Edited: attachment now works.
You do not have the required permissions to view the files attached to this post.
Last edited by aaronmcgranaghan on Thu Nov 01, 2012 2:29 pm, edited 2 times in total.
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Accessibility problems with password protected pdf files

Post by John - Tracker Supp »

The file you have attached is a '.dpt' file - sorry we have no idea what this is and for sure its not a PDF file - and therefore cannot be opened or manipulated by any of our products.

If this was the wrong file or attached in error - please attach the correct file and upload again - otherwise I am afraid we cannot help.

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
Tracker Support
http://www.tracker-software.com
aaronmcgranaghan
User
Posts: 15
Joined: Wed Oct 31, 2012 9:58 am

Re: Accessibility problems with password protected pdf files

Post by aaronmcgranaghan »

John - Tracker Supp wrote:The file you have attached is a '.dpt' file - sorry we have no idea what this is and for sure its not a PDF file - and therefore cannot be opened or manipulated by any of our products.

If this was the wrong file or attached in error - please attach the correct file and upload again - otherwise I am afraid we cannot help.

thanks
This .dpt file is a pdf file embedded with a custom security handler (ESDNow), once decrypted it can be opened and viewed like any normal pdf. The problem we are having is that the permissions set in the document, are restricting us from getting the text to feed to our screen reader.

I have attached a plain pdf file that is also giving us the same problem, you should be able to open this one. This is a password protected pdf with the "Content Copying for Accessibility" property set to "Allowed" and all other properties set to "Not Allowed". The password to open the pdf is claro.

As mentioned above, when we attempt to get the text by:

Code: Select all

pdfMain.DoVerb("Documents[#" + mDocId.ToString() + "].Pages[" + CurrentPageIndex().ToString() + "].Text", "Get", vDataInA, out vDataOut);
We receive the permission error.

Hope this helps.
You do not have the required permissions to view the files attached to this post.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Accessibility problems with password protected pdf files

Post by Vasyl - PDF-XChange »

Hi, Aaron.

The "RemoveSecurity" feature works for a document ONLY when you have specified the correct owner's password.

You are right: currently, in cases where ("Content Copying" == "Not Allowed") AND ("Content Copying for Accessibility" == "Allowed"), we are still preventing copying of text from the page..

Because for now we have no idea how we can allow the extraction of text when ("Content Copying" == "Not Allowed") but allowed for accessibility.

If we did allow then this security restriction will be not respected and we will have new problems with support of protected documents.

We will try to solve this "collision" (thanks to Adobe :-( ) in the new version (3) of the SDK, therefore we ask for your patience until then ...

Best
Regards.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
aaronmcgranaghan
User
Posts: 15
Joined: Wed Oct 31, 2012 9:58 am

Re: Accessibility problems with password protected pdf files

Post by aaronmcgranaghan »

Vasyl-Tracker Dev Team wrote:Hi, Aaron.

The "RemoveSecurity" feature works for a document ONLY when you have specified the correct owner's password.

You are right: currently, in cases where ("Content Copying" == "Not Allowed") AND ("Content Copying for Accessibility" == "Allowed"), we are still preventing copying of text from the page..

Because for now we have no idea how we can allow the extraction of text when ("Content Copying" == "Not Allowed") but allowed for accessibility.

If we did allow then this security restriction will be not respected and we will have new problems with support of protected documents.

We will try to solve this "collision" (thanks to Adobe :-( ) in the new version (3) of the SDK, therefore we ask for your patience until then ...

Best
Regards.
I see. Thanks for the reply, I understand your situation. Hopefully you can resolve this issue in the near future.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Accessibility problems with password protected pdf files

Post by Stefan - PDF-XChange »

Hi Aaron McGranaghan,

And thanks for the understanding!
As Vasyl pointed out - we will try to come up with a compromise in V3 of our Viewer (SDK).

Regards,
Stefan
aaronmcgranaghan
User
Posts: 15
Joined: Wed Oct 31, 2012 9:58 am

Re: Accessibility problems with password protected pdf files

Post by aaronmcgranaghan »

Hi,

As an update to this problem, we have recently received a pdf from the third party mentioned. This pdf has the properties "Content Copying" set to "Allowed" and "Content Copying for Accessibility" set to "Allowed", yet it still produces the same exception "No permissions for current action" when we try to get the text. What is it that determines if we can copy text? I assumed it was these "Content Copying" properties but I may be wrong.

This pdf does read aloud in Adobe Acrobat.
You do not have the required permissions to view the files attached to this post.
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Accessibility problems with password protected pdf files

Post by John - Tracker Supp »

Hi Aaron,

it appears we need a password for this file ?
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
Tracker Support
http://www.tracker-software.com
aaronmcgranaghan
User
Posts: 15
Joined: Wed Oct 31, 2012 9:58 am

Re: Accessibility problems with password protected pdf files

Post by aaronmcgranaghan »

John - Tracker Supp wrote:Hi Aaron,

it appears we need a password for this file ?
Yes I put it on the file attachment comments? The password is: pass
aaronmcgranaghan
User
Posts: 15
Joined: Wed Oct 31, 2012 9:58 am

Re: Accessibility problems with password protected pdf files

Post by aaronmcgranaghan »

Hi,

Has there been any update on this? Did anyone manage to take a look at the pdf I provided? It has "Content Copying" set to "Allowed" but I don't think it is actually allowed...

We seem to have hit a wall here in developing our application; PDF viewer can't extract the text we need for our screen reader and the third party responsible for producing the protected PDF files won't set "Content Copying" to "Allowed" in order for us to get the text for our screen reader.
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Accessibility problems with password protected pdf files

Post by John - Tracker Supp »

Hi,

I appreciate your frustration - but i need to explain in a little more depth here the inconsistencies in approach being applied by both OpenOffice when creating the file and Adobe when opening - we are adhering to the PDF specification - but in the example provided both OpenOffice and Adobe are not ...

So - in the example file provided - the user Password and owner password are set the same as 'pass'

That's the first problem - this should not be allowed - you cannot do this in our products - or indeed Adobe's - the owner and user password must be different or the file save will be blocked - please try in Adobe and you will receive an error message - its not allowed under the PDF specification.

The 2nd problem is when opening the file - because you have set the same owner and user password Adobe is opening the file in 'Owner' mode - and therefore all security and encryption can be bypassed by using this password - you may as well have just set the permissions to 'allowed' for everything because in Adobe Reader - all the file permission limitations have been removed as soon as you provide the user password - because it is the same as the owner - again this is wrong - by strict adherence to the standard this file should be opened in 'User' mode and the file permissions/restrictions adhered to.

So in a nutshell - the problem is initiated when the file is created (the same User and Owner password SHOULD NOT be allowed to conform with the PDF specification) and this is then compounded by Adobe Reader essentially providing a workaround and completely removing all restrictions as soon as the password is entered.

Now to be pragmatic and non judgmental - how many of these files are you likely to encounter and are you or is some 3rd party the original creators of these files - we need to know this before we can start to look at a reliable and 'Legally' acceptable solution.

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
Tracker Support
http://www.tracker-software.com
aaronmcgranaghan
User
Posts: 15
Joined: Wed Oct 31, 2012 9:58 am

Re: Accessibility problems with password protected pdf files

Post by aaronmcgranaghan »

Thank you for your reply John and for the clarification on the pdf file.

The file "test(2)" I recently uploaded is not a typical pdf that our application aims to open. It was a response by the third-party when we told them that we need the pdfs to have Content Copying allowed in order for our application (and PDF-Viewer) to be able to get the text; which they have messed up by setting the user and owner password to be the same.

What the real problem entails, is PDF-Viewer being able to extract text when only "Content Copying for Accessibility" is set to allowed, and all other properties are set to not allowed.
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Accessibility problems with password protected pdf files

Post by John - Tracker Supp »

Hi Aaron,

can you please send me an email FAO: John Verbeeten to support@pdf-xchange.com and I will provide some further detail and info.

Also please include a link back to this post for reference.

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
Tracker Support
http://www.tracker-software.com
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Accessibility problems with password protected pdf files

Post by John - Tracker Supp »

Hi Aaron (et al) ...

pleased to advise the new functionality for 'Read out Loud' is now complete and available and the better news is we have been able to provide this without requiring any special access or agreement being required of you.

If you download the latest build of our products you should find the required functionality is available using the existing functions and require no additional coding or calls.
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
Tracker Support
http://www.tracker-software.com