Linux pdf to text1/9/2023 The font could then be referenced in our template: URL fontPath = Thread.currentThread().getContextClassLoader().getResource("DejaVuSans.ttf") įontFactory.register(fontPath.toString(), "DejaVuSans") Ĭom. f = FontFactory.getFont("DejaVuSans", BaseFont.IDENTITY_H, BaseFont.EMBEDDED) ![]() With our ttf in the project directory, we used the following code to access our ttf as embedded PDF font: We encountered a similar problem recently, and our solution was as follows. Post Edited by giroe janssen at 04/03/09 09:00 The fact that it is correct on windows is just pure luck than? Linux & Windows pick a default font to calculate space & stuff? And because they use different defailt fonts, the text is truncated on linux sometimes? When I run this on Linux, I dont see the font helvetica either (Linux has much less fonts btw, around 20, windows has around 250). When I run this in windows (where everything is fine). String fontNames = ge.getAvailableFontFamilyNames() GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment() Because it's the standard? Or why? (when I use Helvetica Bold, I do see it in the jrxml file btw) How can I check what fonts are available on the linux machine? Sorry about all the questions, but when text is missing it's pritty irritating :) Thanks for your help, NickĮDIT, I tried to find how I can see what fonts are available in java.awt. I know what the problem is, but not what the solution is :) So the problem is: PDF fonts do not match the Java fonts? But what to do about this :)? Helvetica is a pritty standard font.? Btw, If I say the font of a textfield (in iReport) is helvetica. (I dont got the TTF file for helvetica, because it's not free?) I've read that you can embed the pdf font? But than you have to have the TTF file or am I wrong? Is there an easy way to solve this (perhaps with another font or so) I hope I can get some 'personal' assistence from you guys. I know that there are threads about this problem.īut I'm not able to get this working. I know this is some kind of font type issue. I sometimes get te same problem that my text goes out of it's field. (this is not a 'real' example, but just to let you know what my problem is) This is just a test, on windows it does not get tru This is just a test, on windows it does not get truncated, nananananana ![]() En everything looks fine when I run my webapp on windows (for development).īut when I run it on Linux some text is missing. My problem is, I got some 'long' textfields.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |