You should make sure that the font is present and available when you deploy your application.Ĭlick How to use the font Verdana in PdfStamper? if you want to see how to answer this question in iText 5. Verdana is a humanist sans-serif typeface designed by Matthew Carter for Microsoft Corporation, with hand-hinting done by Thomas Rickner, then at Monotype. I am using this hard coded path by way of example. ![]() This code won't work on the server where I host the iText site, though (which is a Linux server that doesn't even have a c:/windows/fonts directory). Note that the font is now embedded (the third parameter is true) because the same problem you have on your side, will also occur on the side of the person who looks at your file: his PDF viewer can render Standard Type 1 fonts, but may not be able to render other fonts such as Verdana.Ĭaveat: The hard coded path "c:/windows/fonts/verdana.ttf" works for me on my local machine because the font file can be found using that path on my local machine. PdfFont font = PdfFontFactory.createFont("c:/windows/fonts/verdana.ttf", PdfEncodings.IDENTITY_H, true) ![]() You need to provide the path to the Verdana font file. 1251 Cyrillic 1253 Greek 1254 Turkish 1257 Windows Baltic Mac Roman Macintosh Character Set (US Roman) Fixed pitch: False. iText has no idea about the font metrics of other fonts (Verdana isn't a Standard Type 1 font). ![]() ![]() IText can support the Standard Type 1 fonts, because iText ships with AFM file (Adobe Font Metrics files). Posted on StackOverflow on by Alain Sarti I'd like to change that to the Verdana Font, but simply exchanging the Part BaseFont.HELVETICA with "Verdana" doesn't work.
0 Comments
Leave a Reply. |