Answer the question
In order to leave comments, you need to log in
How to write paths to fonts and images in JasperReports template files?
Hello. It is necessary to implement the creation and saving of reports in the program. At the moment, a self-written implementation is used. I want to replace it with JasperReports. The report template was compiled, everything seems to be fine, but there is a problem with fonts and pictures. The module responsible for the graphical interface is pulled up separately for me. Actually, everything is in it. I import it as a jar-nick (via gradle, pull from local maven repository). I also tried to place fonts in the resources of the GUI module and in a separate folder of the final project (which is used to build the running application - AWP). The path also tried to prescribe differently: "../config/font/ARIAL.TTF", "./config/font/ARIAL.TTF", "config/font/ARIAL.TTF", "./font/ARIAL. TTF". Folder "config"
The whole tag I use to change the font looks like this:
<style name="Default" isDefault="true" pdfFontName="../config/font/ARIAL.TTF" pdfEncoding="Cp1251"/>
Answer the question
In order to leave comments, you need to log in
This path helped: "config/font/ARIAL.TTF", however, the file is located in the main project, which is not very logical and convenient. But in that folder there was already some kind of font, which means that this is already being practiced (the project is not mine, I came to such a one).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question