I am trying to get a CCITTFax encoded stream out of a pdf file.
PdfReader.getStreamBytes(PRStream stream) reads a byte stream from the
pdf file, decrypts the stream if neccessary, attempts to apply any
filters to the stream, and then returns the byte array. This would be
perfect for what I need to do, except that the method does not recognize
the /CCITTFaxDecode filter. The method throws an IOException: "The
filter /CCITTFaxDecode is not supported." While I understand why this
method was coded in this way, it makes it impossible for me to actually
get to the byte array for my CCITT data. If the method were to simply
return the unfiltered byte array in the case that it found a filter it
did not recognize, then the user would be able to apply the appropriate
filter manually. I have code to decode the CCITT data, but this method
will not let me get to the data.
The following code does actually get the byte stream from the file,
however my pdfs are encrypted and thus the byte array is encrypted. I am
unable to decrypt the stream manually because the PdfReader.getDecrypt()
is a private method.
RandomAccessFileOrArray rf = reader.getSafeFile();
rf.reOpen();
rf.seek(offset);
rf.readFully(encoded_data);
rf.close();
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions