Home
Analytics
Custom Font for PDF
vrlekshmi
Hello all,
How to embed a custom font while generating a PDF Report in BIRT?
Find more posts tagged with
Comments
Bsupport
Hi Vrlekshmi,<br />
<br />
In the beforeFactory you can set it for the style like:<br />
SN = reportContext.getReportRunnable().designHandle.getDesignHandle().findStyle("stylename"); <br />
SN.setStringProperty("fontFamily", "arial");<br />
<br />
In the same manner you can set the size?<br />
<br />
Hope this might help you.<br />
<br />
<br />
Regards,<br />
Birtsupport<br />
<a class='bbc_url' href='
http://www.reportinghouse.com'>Reporting
House: Our Focus...Your Reports</a>
vrlekshmi
Hi,
I tried this but I am not able to get it. One doubt regarding the code, should I create a new style for the strings to display and apply that style.
I have made the changes in the code as follow:
SN = reportContext.getReportRunnable().designHandle.getDesignHandle().findStyle("TextStyle");
SN.setStringProperty("fontFamily", "RaghuMalayalam");
Whats is this SN?
Also I need 2 fonts in the PDF at the same time, i.e I want to use both English and Malayalam fonts.
gliu
If you wants use custom TrueType font in PDF report, two steps should follow:
1. set the fontfamily style to the custom font.
2. Copy the TrueType font to system fonts folder or add the font path to font-paths section in plugins/org.eclipse.birt.report.engine.fonts/fontConfig.xml. More detail information please refer to the comments in the fontConfig.xml file.