• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to change the font-family in XSLT file

 
prashant fusate
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created xml to pdf using xslt now I have problem of changing the font of generated pdf file.

How can I change the font of generated pdf file.

How can I specify the font-family in xslt file so that generated pdf file will be in that specified font.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is nothing to do with XSLT per-say. Consult the documentation for whatever API you use to create your PDF.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are asking about XSL-FO, I just searched the web and found out that the <fo:block> element can have a font-family attribute.
 
prashant fusate
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Paul Clapham
Thanks for your update.

But when I used font-family="arial" at that time it does not make any sence.
because arial is not a standerd font for FOP.So how can I used my winodows font to genrate the output PDF file

Thank you
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the problem this? You may need to keep a font configuration file.
 
prashant fusate
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the document,
But my problem is something different I want to register windows font with FOP.

To do that I have genrated respective xml files(arial.xml,arialdb.xml ) by using windows arial.ttf file

java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;
lib\xercesImpl.jar;lib\xalan.jar
org.apache.fop.fonts.apps.TTFReader enc ansi D:\iBOLT2.5sp6b\projects\PDFArial\fop-config\font\ariali.ttf D:/iBOLT2.5sp6b/projects/PDFArial/fop-config\xml\ariali.xml

and specified genrated xml file in configuration file(i.e userconfig.xml ) to register the windows font in FOP.

by doing all this thing also I am not get output pdf with arial font

Could you please suggest what is wrong I am doing here.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not get output pdf with arial font

What does this mean? Are there exceptions during PDF generation? Does the text not show up in the PDF? Does it appear in some other font? When viewing the font, are all desired fonts accessible?
 
prashant fusate
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Yes I getting the are as follows
unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any

i.e it is not registered with fop

how can i solve this issue?\

Thank you very much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic