Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] Xml2Rtf Font Selection Problem

Andreas Furtner

2007-06-15


Is seems not possible to select fonts other than the base PDF-fonts,
when generating RTF using iText's XMLProcessor.

For instance if I want to render "Arial", it works by using the programmatic approach, working with RtfFont like

new RtfFont("Arial", 14, Font.BOLD)

but if I do it declarative by processing XML, it doesn't work.


Someone had the same problem 2 years ago, too.
I'm referring to this thread:

http://article.gmane.org/gmane.comp.java.lib.itext.general/15588/

http://article.gmane.org/gmane.comp.java.lib.itext.general/15595/

http://article.gmane.org/gmane.comp.java.lib.itext.general/15596/

My question is, if anybody found a solution to this?


Here is an excerpt of my xml tagmap:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE tagmap [
<!ENTITY StdFont "Arial">
<!ENTITY StdFontSize "10">
<!ENTITY TableWidth "100">
<!ENTITY StdOffSet "5">
]>

<tagmap>
<tag name="iText" alias="LOCATION" />

<!-- defines a bold text phrase -->
<tag name="phrase" alias="BOLD">
<attribute name="size" value="&StdFontSize;" />
<attribute name="font" value="&StdFont;" />
<attribute name="style" value="bold" />
</tag>

<!-- defines a normal text phrase -->
<tag name="phrase" alias="NORMAL">
<attribute name="size" value="&StdFontSize;" />
<attribute name="font" value="&StdFont;" />
<attribute name="style" value="normal" />
</tag>

<!-- ... -->
</tagmap>



And in the Template xml then there is something like:

<BOLD>Date:</BOLD>
<NORMAL>15.06.2007</NORMAL>


Bold and normal works, but it's standard "Times New Roman" font, not "Arial"

Maybe You can help me.

Thanks,
Andreas Furtner

______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!    
Jetzt gratis testen! http://produkte.web.de/club/?mc=021130


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
©2008 junlu.com - Jax Systems, LLC, U.S.A.