You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Ishan Pandya <i_...@yahoo.co.in.INVALID> on 2016/08/11 06:52:51 UTC

PDF Box Copy Permissions

Hi All Devs, 
We are using PDFBox for evaluation purpose and are testing encryption / decryption functionality of yours. We have observed a scenario when encrypting a document that even when setting the setCanExtractContent() to true, the copy command does not show up in acrobat readers. But when I open the PDF using owner password, the copy command shows up properly. 
The scenario means, if I allow the user who has user password to allow setCanExtractContent to true, he should be able to copy the content via PDF Reader applications like Abrobat Reader. Please find below sample code of the scenario:
AccessPermission ap = new AccessPermission();ap.setCanExtractContent(permissions.Copy);
StandardProtectionPolicy spp = new StandardProtectionPolicy(ownerPassword, userPassword);spp.setEncryptionKeyLength(keyLength);spp.setPreferAES(preferAES);spp.setPermissions(ap);doc.protect(spp);doc.save(outputFile);doc.close(); 
Can someone guide me with this scenario if I am doing anything wrong or so.
Thanks in advance. Your help is much appriciated.   Regards,
Ishan Pandya


Re: PDF Box Copy Permissions

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 11.08.2016 um 08:52 schrieb Ishan Pandya:
> Hi All Devs,
> We are using PDFBox for evaluation purpose and are testing encryption / decryption functionality of yours. We have observed a scenario when encrypting a document that even when setting the setCanExtractContent() to true, the copy command does not show up in acrobat readers. But when I open the PDF using owner password, the copy command shows up properly.
> The scenario means, if I allow the user who has user password to allow setCanExtractContent to true, he should be able to copy the content via PDF Reader applications like Abrobat Reader. Please find below sample code of the scenario:
> AccessPermission ap = new AccessPermission();ap.setCanExtractContent(permissions.Copy);
> StandardProtectionPolicy spp = new StandardProtectionPolicy(ownerPassword, userPassword);spp.setEncryptionKeyLength(keyLength);spp.setPreferAES(preferAES);spp.setPermissions(ap);doc.protect(spp);doc.save(outputFile);doc.close();
> Can someone guide me with this scenario if I am doing anything wrong or so.
> Thanks in advance. Your help is much appriciated.   Regards,
> Ishan Pandya
>
>

Please mention what version you are using, and upload the "protected" 
file on a sharehoster, and post the link.


Make sure that "permissions.Copy" is really true at runtime.


Tilman



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org