pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkuehler <andr...@lehmi.de>
Subject Re: I Have a question on PDDocument.getCurrentAccessPermission().canPrint()
Date Mon, 24 Jun 2013 13:22:21 GMT
Hi,

Am 24.06.2013 15:12, schrieb Gilad Denneboom:
> What do you mean? I created the file myself in Acrobat and applied a
> Password Security to it with Printing Allowed set to None.
As I said if nothing is set, default values are used. So my guess was wrong, you
are obviuously using some non default values. It looks like PDFBox doesn't read
the permission bits correct. Saying said please follow your own suggestion and
create a ticket on JIRA and attach a sample pdf to it.


Thanks in advance.
Andreas Lehmkühler

> On Mon, Jun 24, 2013 at 3:05 PM, Andreas Lehmkuehler <andreas@lehmi.de>wrote:
>
>> Hi,
>>
>> Am 24.06.2013 14:11, schrieb Gilad Denneboom:
>>
>>   I'm seeing the same issue... You might want to report it in the PDFBox
>>> JIRA: https://issues.apache.org/**jira/browse/PDFBOX<https://issues.apache.org/jira/browse/PDFBOX>
>>> Also, ap.getPermissionBytes() returns -4, which is odd.
>>>
>> Your pdf doesn't have any specific access permission, so that the default
>>
>> access permission is used which will always return "true" for any single
>> feature and getBytes always returns "-4".
>>
>>
>>   On Mon, Jun 24, 2013 at 1:02 PM, KUCHI BHARGAV <mr.adfcoder@gmail.com
>>>> wrote:
>>>
>>>   Hi All,
>>>>    I am working on PDF document features extraction
>>>>
>>>> i want to know whether the given pdf is printable or not
>>>> i have used the below code snippet  to test this scenario.
>>>>
>>>>       public void testDocument(String dirfile){
>>>>           PDDocument    doc=null;
>>>>           try {
>>>>             doc = PDDocument.load(dirfile);
>>>>           } catch (IOException ie) {
>>>>               System.out.println(ie);
>>>>           }
>>>>
>>>>           AccessPermission ap = doc.**getCurrentAccessPermission();
>>>>           if (ap == null) {
>>>>               System.out.println("Cannnot read access permission");
>>>>           }
>>>>         System.out.println(ap.**canPrint());
>>>>       }
>>>>
>>>> The above highlighted code is allways returning true
>>>>
>>>> irrespective of the document print option ?
>>>>
>>>> is there any alternative way to check the pdf printing feature ?
>>>>
>>>>
>>>> Thanks & Regards,
>>>> Bhargav K
>>>>
>>>
>> BR
>> Andreas Lehmkühler


Mime
View raw message