Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

how to change the font-family in XSLT file

 
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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE 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.
 
Marshal
Posts: 25478
67
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
 
Rancher
Posts: 43015
76
  • 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: 43015
76
  • 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.
 
Not so fast naughty spawn! I want you to know about
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic