pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan G <joh...@comcast.net>
Subject Re: How to get: isOptimized, hasCompressedStreamObjects, allowsCommenting ?
Date Tue, 11 Dec 2012 17:06:07 GMT
Maruan, thank you. Re: a) Fast Web View / Linearization .... you can look up the existence
of a linearization parameter dictionary which must exist within the first 1024 bytes of the
pdf. Any further help for how to code that would be deeply appreciated . Re: b) Compressed
stream objects ... PDFBox does deal with compressed stream objects just fine.. (no indicator
is set) if a compressed stream object is encountered. And for this too please, anyone? Can
you somehow parse and then set your own flag if you encounter a compressed stream object during
that parsing? I have spent time looking for code examples and have also tried some code snippets.
But have not yet been able to accomplish either of the above and may be well off onto the
wrong track. Thanks again for any consideration. Johan in Seattle ----- Original Message -----
| From: "Maruan Sahyoun" <sahyoun@fileaffairs.de>
| To: users@pdfbox.apache.org
| Sent: Wednesday, December 5, 2012 7:35:25 AM
| Subject: Re: How to get: isOptimized, hasCompressedStreamObjects,
| allowsCommenting ?
| Hi Johan,
| to best of my knowledge
| a) Fast Web View / Linearization
| PDFBox doesn't have specific code for linearization so something like
| isLinearized() or isFastWebView() is not available. In order to find
| out for yourself if a pdf is linearized you can look up the existence
| of a linearization parameter dictionary which must exist within the
| first 1024 bytes of the pdf. The layout is like this:
| << /Linearized 1.0 % Version
| /L 54567 % File length
| /H [475 598] % Primary hint stream offset and length (part 5)
| /O 45 % Object number of first page’s page object (part 6)
| /E 5437 % Offset of end of first page
| /N 11 % Number of pages in document
| /T 52786 % Offset of first entry in main cross-reference table (part
| 11)
| >>
| The complete spec can be found in Annex F of ISO-32000
| b) Compressed stream objects
| PDFBox does deal with compressed stream objects just fine.
| Unfortunately there is currently no document info I know of which is
| set if a compressed stream object is encountered.
| c) Commenting
| Please review
| http://pdfbox.apache.org/apidocs/org/apache/pdfbox/pdmodel/PDDocument.html#getCurrentAccessPermission%28%29
| and
| http://pdfbox.apache.org/apidocs/org/apache/pdfbox/pdmodel/encryption/AccessPermission.html
| With kind regards
| Maruan Sahyoun
| > Hi, am still hoping for help on if PDFBox can determine these
| > attributes. Thanks again ----- Original Message -----
| > | Hi All,
| > | How can I determine in Java if a PDF file matches these
| > | requirements?
| > | • The file is optimized for Fast Web Viewing.
| > | • The file does not contain compressed stream objects.
| > | • The Document restrictions allow Commenting. // Am using
| > | ap.canModifyAnnotations()

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message