OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 177 Rev 180
Line 152... Line 152...
152
            FileOutputStream fileOutputStream = new FileOutputStream(pdfFileToCreate);
152
            FileOutputStream fileOutputStream = new FileOutputStream(pdfFileToCreate);
153
 
153
 
154
            PdfBoxGraphics2DFontTextDrawer fontTextDrawer = new PdfBoxGraphics2DFontTextDrawerDefaultFonts();
154
            PdfBoxGraphics2DFontTextDrawer fontTextDrawer = new PdfBoxGraphics2DFontTextDrawerDefaultFonts();
155
            final File dir = new File("Fonts");
155
            final File dir = new File("Fonts");
156
            if (dir.exists()) {
156
            if (dir.exists()) {
-
 
157
                System.out.println("Using fonts dir : " + dir.getAbsolutePath());
-
 
158
                for (File f : dir.listFiles()) {
-
 
159
                    if (f.isFile() && f.getName().toLowerCase().endsWith(".ttf")) {
-
 
160
                        System.out.println("Registering font : " + f.getAbsolutePath());
157
                fontTextDrawer.registerFontFromDirectory(dir);
161
                        fontTextDrawer.registerFont(f);
-
 
162
                    }
-
 
163
                }
-
 
164
 
-
 
165
            } else {
-
 
166
                System.out.println("No custom fonts dir found : " + dir.getAbsolutePath());
158
            }
167
            }
159
 
168
 
160
            // Configure the renderer
169
            // Configure the renderer
161
            ODTRenderer renderer = new ODTRenderer(doc);
170
            ODTRenderer renderer = new ODTRenderer(doc);
162
            renderer.setIgnoreMargins(false);
171
            renderer.setIgnoreMargins(false);