Package org.openpdf.renderer.decode
Class PDFDecoder
java.lang.Object
org.openpdf.renderer.decode.PDFDecoder
A PDF Decoder encapsulates all the methods of decoding a stream of bytes
based on all the various encoding methods.
You should use the decodeStream() method of this object rather than using any of the decoders directly.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classUtility class for reading and storing the specification of Filters on a stream -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBufferdecodeStream(PDFObject dict, ByteBuffer streamBuf, Set<String> filterLimits) decode a byte[] stream using the filters specified in the object's dictionary (passed as argument 1).private static StringgetCryptFilterName(PDFObject param) The name of the Crypt filter to applystatic booleanisEncrypted(PDFObject dict) Determines whether a stream is encrypted or not; note that encodings (e.g., Flate, LZW) are not considered encryptions.static booleanisLastFilter(PDFObject dict, Set<String> filters)
-
Field Details
-
DCT_FILTERS
-
-
Constructor Details
-
PDFDecoder
private PDFDecoder()Creates a new instance of PDFDecoder
-
-
Method Details
-
isLastFilter
- Throws:
IOException
-
decodeStream
public static ByteBuffer decodeStream(PDFObject dict, ByteBuffer streamBuf, Set<String> filterLimits) throws IOException decode a byte[] stream using the filters specified in the object's dictionary (passed as argument 1).- Parameters:
dict- the dictionary associated with the streamstreamBuf- the data in the stream, as a byte buffer- Throws:
IOException
-
getCryptFilterName
The name of the Crypt filter to apply- Parameters:
param- the parameters to the Crypt filter- Returns:
- the name of the crypt filter to apply
- Throws:
IOException- if there's a problem reading the objects
-
isEncrypted
Determines whether a stream is encrypted or not; note that encodings (e.g., Flate, LZW) are not considered encryptions.- Parameters:
dict- the stream dictionary- Returns:
- whether the stream is encrypted
- Throws:
IOException- if the stream dictionary can't be read
-