I am trying to follow your recommendations, however I am having a few
problems. I have been trying to use TiffImage.getTiffImage() to extract
the tiff images from my pdf.
1. First, I tried to use PdfReader.getSafeFile() after opening my pdf
with the PdfReader and passed the RandomAccessFileOrArray to
TiffImage.getTiffImage(). For some reason, the RandomAccessFileOrArray
returned from PdfReader.getSafeFile() contains a null RandomAccessFile
reference. This null pointer causes an exception in
TiffImage.getTiffImage(). Is getSafeFile() broken, or am I doing
something wrong?
2. Next, I created a RandomAccessFileOrArray directly using my pdf's
filename and the constructor. Then, I tried to get the first tiff from
the pdf using TiffImage.getTiffImage(), but I get an exception "Bad
endianness tag..."
3. Next, I used PdfReader.getPageN() to get the dictionary for a page
and used it to eventually get a PRStream to the image. Then I tried
creating a RandomAccessFileOrArray using the PRStream.getBytes() and
also with PdfReader.getStreamBytes(PRStream). Then, I pass this
fileorarray to TiffImage.getTiffImage() and I again get a "Bad
endianness tag..." exception.
There must be something I am missing. Would you might providing a little
more insight? I really appreciate your time and help.
Thank you,
John
Paulo Soares wrote:
If you want a CCITTFax decoder look at
com.lowagie.text.pdf.codec.TIFFFaxDecoder.java. Look at TiffImage.java
for info on how to use it. You can extract streams with
PdfReader.getStreamBytes().
----- Original Message ----- From: "John Pruitt" <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>
Cc: <itext-questions@lists.sourceforge.net>
Sent: Tuesday, November 22, 2005 7:25 PM
Subject: Re: [iText-questions] CCITTFax Decode
I believe the following (taken from CCITTFaxDecodeFilter.java of
pdfbox) might explain why pdfbox does not decode my pdfstream and
produce the images I need:
public void decode( InputStream compressedData, OutputStream
result, COSDictionary options ) throws IOException
{
org.pdfbox.util.ErrorLogger.log( "Warning:
CCITTFaxDecode.decode is not implemented yet, skipping this stream." );
}
The decoder has not been implemented. I have been searching for 2
weeks now for a decoder.
John
Paulo Soares wrote:
Use pdfbox to extract the images.
----- Original Message ----- From: "John Pruitt" <[EMAIL PROTECTED]>
To: <itext-questions@lists.sourceforge.net>
Sent: Tuesday, November 22, 2005 6:20 PM
Subject: [iText-questions] CCITTFax Decode
My company has been using iText successfully to convert multi-page
tiff files into encrypted pdf files for some time now. I am working
on a project in which I need to convert these pdf files back to
multi-page tiffs. I am aware that iText is primarily designed for
creating pdfs as opposed to extracting content from pdfs, however
this is a simple, specific case in which each page consists of a
single, full-page image. I was wondering if there might be an easy
way to extract these images with iText? I am looking through the
com.lowagie.text.pdf.codec classes, but have yet to understand how
I might be able to use them. I have also looked into another Java
pdf library called "pjx." With pjx I am able to get the PdfStream
data for the images out, however I am having trouble finding a
CCITTFax decoder to decode the stream. Ideally, I would like to get
the images in a java.awt.* format.
If anyone could provide any insight, leads, links, sample code,
etc, it would be greatly appreciated.
Thank you very much,
John
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
-------------------------------------------------------
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
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions