Hi,
I think I have a related problem here. I'm trying to import a simple
RTF document that contains a logo (for context, I will then have to
add some dynamic content from my DB to the doc). I was given the
document as a base to start with, so I'm not sure of the type of the
image that iText doesn't recognize, but here's the code that gives me
the exception below:
RtfDocument doc = new RtfDocument();
RtfParser r = new RtfParser();
ClassPathResource letter = new
ClassPathResource("/com/path/to/rtf/letterhead.rtf");
r.importRtfDocument(letter.getInputStream(), doc);
java.io.IOException: The byte array is not a recognized imageformat.
at com.lowagie.text.Image.getInstance(Unknown Source)
at
com.lowagie.text.rtf.parser.destinations.RtfDestinationShppict.addImage(Unknown
Source)
at
com.lowagie.text.rtf.parser.destinations.RtfDestinationShppict.handleCloseGroup(Unknown
Source)
at com.lowagie.text.rtf.parser.RtfParser.handleCloseGroup(Unknown
Source)
at com.lowagie.text.rtf.parser.RtfParser.tokenise(Unknown Source)
at com.lowagie.text.rtf.parser.RtfParser.importRtfDocument(Unknown
Source)
at com.DaoTest.testCreateRtf(DaoTest.java:63)
For some reason Eclipse is not allowing me to step through the source
code (it can't figure out line numbers on its own), so it's slowing
down my debugging somewhat.
fyi, ClassPathResource is a Spring class that helps get me the
InputStream that importRtfDocument requires.
Is this issue related? How can I tell what the imageformat is and
what is a recognized image format I should convert the logo to?
Thanks, Kianoosh
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar