The community of Analytics developers are invited to follow and participate in the developer network.
OpenText technical experts collaborate with supported customers and partners in the Magellan product area.
OpenText technical experts collaborate with supported customers and partners in the Magellan product area.
Embedding fonts to pdf using report engine api

Hi!
I try to generate a pdf report and embed some custom fonts in it.
Generating the report works. I configured the custom fonts in the fontConfig.xml of the report engine. But i dont't know how to tell birt to embed these fonts into the pdf file.
Any hints?
Thanks a lot!
Stefan
I try to generate a pdf report and embed some custom fonts in it.
Generating the report works. I configured the custom fonts in the fontConfig.xml of the report engine. But i dont't know how to tell birt to embed these fonts into the pdf file.
Any hints?
Thanks a lot!
Stefan
0
Comments
<br />
Here's a thread from eclipse.org that might help you out with that.<br />
<br />
<a class='bbc_url' href='http://dev.eclipse.org/newslists/news.eclipse.birt/msg01127.html'>http://dev.eclipse.org/newslists/news.eclipse.birt/msg01127.html</a><br />
<br />
Hope it helps!
Regards,
Michael Williams
eSignLive Evangelism & Community Manager | eSignLive by VASCO
Find me on:
Twitter
Facebook
Blog
LinkedIn
eSignLive Developer Community
Email me:
Google: [email protected]
Thanks for your hint, but i couldn't find a solution to my problem.
I read the posting you told me and found some differences to my situation.
By the way im using birt 2.3.0 on linux
I found the following instructions
1. locating the FOP configuration file for BIRT (fop.xml)
--> I can not find a fop.xml file. But i found a fontsConfig.xml file and added the following lines to the given xml sections:
<font-paths>
...
<path path="/usr/local/share/fonts" />
</font-paths>
<font-encodings>
<encoding font-family="32768 NO" encoding="Cp1252" />
...
</font-encodings>
2. put the font information in the fop.xml
--> Here, i should create a font metric file with apache fop and put some font information to fop.xml. I generated the file, but don't know where to put in the information. I found no 'fonts' section.
3. create the font matrix file that is need by FOP
--> I created the file, but it isn't in use, because of missing configuration in step 2, i think.
With my configuration, i get a pdf and the font is correctly shown on my system, where the font is installed. But if i print the document on paper, the font is missing. I really get stucked!
Regards,
Stefan
If you want embed a TrueType font to PDF report in BIRT2.3.0, what you shoud do is to add the font path to fontconfig.xml in org.eclipse.birt.report.engine.fonts plugin.
<br />
i m not sure if it's enough to just add the font to that xml file.<br />
I already embedded custom fonts while running reports using the report engine api directly.<br />
So when it comes to output format PDF i set the properties of the PDFRenderOption object accorindgly. All i needed to do was adding the following lines of Java code to my reporting service:<br />
<br />
<br />
... // i asume that you already have a object of type IPDFRenderOption<br />
pdfRenderOption.setFontDirectory("C:/myFontLocation");<br />
pdfRenderOption.setEmbededFont(true);<br />
<br />
<br />
also see <a class='bbc_url' href='http://www.birt-exchange.org/documentation/BIRT_220/EngineJavadoc/engine/api/org/eclipse/birt/report/engine/api/IPDFRenderOption.html'>IPDFRenderOption (Birt Engine API)</a> for javadoc
<p> </p>
<p>I have a similar requirement. I am using a font on my local machine in my report to generate PDFs. If upload this .rptdesign file on the server, will the font be automatically embedded in the file? </p>
<p> </p>
<p>If not, how else do I make sure that the report continues to use the same font ion the server?</p>
<p> </p>
<p>Thanks!</p>
<p> </p>
<p>If you are wanting to generate PDF output on the server with the fonts embedded, then the font will need to be installed on the sever as well. The font is not embedded into the rptdesign directly.</p>
Regards,
Jesse Freeman
Solution Consultant
OpenText Corporation
http://www.actuate.com | http://www.opentext.com
<p> </p>
<p>I used RCP Designer to design the report using the Century Gothic font on a Windows Machine. </p>
<p> </p>
<p>But when I open it in the Eclipse All-in-one on a<strong> Mac</strong> which <u><em>h<em><u>as</u></em> the same font installed</em></u>, the report defaults to some other font.</p>
<p> </p>
<p>In eclipse on Mac I only have the font choices of <em>Cursive, Fantasy, Monospace, Sans Serif and Serif</em>. </p>
<p> </p>
<p>How do I make sure the same font displays all the time?</p>
<p> </p>
<p>Thanks!</p>
<p> </p>
If the font is installed on the machine in the default location it should be picked up by the eclipse designer.</p>
<p> </p>
<p>You should also inspect the fontsConfig.xml for you environment and make sure that the location where your fonts are installed is listed.</p>
Regards,
Jesse Freeman
Solution Consultant
OpenText Corporation
http://www.actuate.com | http://www.opentext.com
Hello,
For custom configuration we need to configure font path in birt runtime jar .
For that you need to below point
1. First we have to put custom fonts in separate path .
2. Put font .ttf files int that path
3.Extract org.eclipse.birt.runtime_4.4.2.v20150217-1805.jar
4.Find fontConfig.xml .Go to section.Int that add .save the file
5.Make all the files as jar and keep the jar in your birt location.
6.Restart the Birt connector
Thanks
Yogesh