> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of David Thielen
> Sent: Thursday, April 12, 2007 6:05 AM
> To: itext
> Subject: [iText-questions] How to set fonts, write text
> 
> 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.
>

No idea what you are talking about.
  
> Under how I do this I also cannot embed fonts in the PDF as 
> it is using IDENTITY mapping.
>

The Identity-H mapping with TT fonts is always embedded.
  
> 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);
>  

You code may make sense in your application but not here. I've no idea
what you are trying to do, if the identation is correct but you forgot
the braces or what internalName or codepage are.

> 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.
>  

Wrong place to ask.

> Any suggestions?

Better questions?

Paulo


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


-------------------------------------------------------------------------
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/

Reply via email to