Hi,
Am 24.06.2013 13:02, schrieb KUCHI BHARGAV:
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 ?
I guess your pdf doesn't limit the access to the document, so that
the default access permission is used which will always return "true"
for any single feature.
is there any alternative way to check the pdf printing feature ?
Open the pdf using adobe acrobat and check the document properties. All
available security features should be listed on the security tab.
Thanks & Regards,
Bhargav K
BR
Andreas Lehmkühler