Hi all

I am trying to decode the cross-reference stream.
The following is what I had done:

PdfReader reader = new PdfReader("test.pdf");
        
PrintStream list = new PrintStream(new FileOutputStream("objects.txt"));
PdfLister lister = new PdfLister(new PrintStream(list));
PdfDictionary trailer = reader.getTrailer();
lister.listDict((trailer));

/* try: get content of trailer */
PRStream content = (PRStream)
reader.getPdfObject(trailer.get(PdfName.STREAM));
byte[] contentstream = PdfReader.getStreamBytes(content);

However, from the portion where I'm trying to get content of trailer, I got
the error that 
"com.lowagie.text.pdf.PdfDictionary cannot be cast to
com.lowagie.text.pdf.PRStream"

Can someone show me the correct way of doing it??


-- 
View this message in context: 
http://www.nabble.com/Decoding-Stream-tp22716357p22716357.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to