Hi;
I think I may be doing this wrong (or at least sub-optimally). I am converting
Word documents to PDF and so I parse the rtf file converting every block of
text to a String. The original rtf is composed mostly of ASCII text but
documents can have DBCS, unicode, and literal byte values that map to a
specific glyph in a font like Wingdings2.
I convert everything to unicode, using the 0x80## value for the literal byte
values. And this all works fine. But I noticed that when I write out a block of
text using Arial for example, it executes code to handle CJK text and is using
encoding/decoding for this. Which makes sense as there could be a CJK character
in there - but there usually isn't.
Under how I do this I also cannot embed fonts in the PDF as it is using
IDENTITY mapping.
What I do is (using Arial as an example - could be any font):
Font font = FontFactory.getFont("Arial", BaseFont.IDENTITY_H, true, 24, 0);
if ((font != null) && (font.getBaseFont() == null))
font.getBaseFont()
font = FontFactory.getFont("Arial", codepage, true, 24, 0);
if ((font != null) && (font.getBaseFont() != null))
font.getBaseFont()
return FontFactory.getFont(internalName, codepage, BaseFont.NOT_EMBEDDED);
And the second problem I have is that in iTextDotNet each time it needs to
encode the text to a byte array, the code throws an exception trying to get an
encoder. It catches it and then does create an encoder - but that's an
exception per block of text and that burns up a lot of clock cycles.
Any suggestions?
thanks - dave
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/