![]() 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. 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) After you find a font that you would like to use with an Office application, you can download it and install it through the operating system that you are currently using on your computer. You need to provide the path to the Verdana font file. 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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |