5
5
6
6
package net .atomique .ksar .export ;
7
7
8
- import com .itextpdf .awt .DefaultFontMapper ;
9
- import com .itextpdf .awt .FontMapper ;
10
8
import com .itextpdf .awt .PdfGraphics2D ;
11
9
import com .itextpdf .text .BaseColor ;
12
10
import com .itextpdf .text .Document ;
@@ -51,12 +49,11 @@ public class FilePDF extends PdfPageEventHelper implements Runnable {
51
49
public FilePDF (String filename , kSar hissar ) {
52
50
pdffilename = filename ;
53
51
mysar = hissar ;
54
-
55
52
}
56
53
57
54
public FilePDF (String filename , kSar hissar , JProgressBar g , JDialog d ) {
58
- pdffilename = filename ;
59
- mysar = hissar ;
55
+ this ( filename , hissar ) ;
56
+
60
57
progress_bar = g ;
61
58
dialog = d ;
62
59
}
@@ -83,10 +80,11 @@ public void run() {
83
80
break ;
84
81
}
85
82
86
- pdfheight = document .getPageSize ().getHeight ();
83
+ float pdfheight = document .getPageSize ().getHeight ();
87
84
pdfwidth = document .getPageSize ().getWidth ();
88
85
pageheight = pdfheight - (2 * pdfmargins );
89
86
pagewidth = pdfwidth - (2 * pdfmargins );
87
+
90
88
try {
91
89
writer = PdfWriter .getInstance (document , new FileOutputStream (pdffilename ));
92
90
} catch (DocumentException | FileNotFoundException ex ) {
@@ -217,19 +215,17 @@ public void IndexPage(PdfWriter writer, Document document) {
217
215
}
218
216
219
217
private int progress_info = 0 ;
220
- private float pdfheight ;
221
218
private float pdfwidth ;
222
219
private int pdfmargins = 10 ;
223
- float pageheight ;
224
- float pagewidth ;
220
+ private float pageheight ;
221
+ private float pagewidth ;
225
222
private int total_pages = 1 ; // page 1 (index)
226
223
private String pdffilename = null ;
227
224
private Document document = null ;
228
225
private PdfWriter writer = null ;
229
226
private PdfContentByte pdfcb ;
230
227
private kSar mysar = null ;
231
- FontMapper mapper = new DefaultFontMapper ();
232
- BaseFont bf = FontFactory .getFont (FontFactory .COURIER ).getCalculatedBaseFont (false );
228
+ private BaseFont bf = FontFactory .getFont (FontFactory .COURIER ).getCalculatedBaseFont (false );
233
229
private JProgressBar progress_bar = null ;
234
230
private JDialog dialog = null ;
235
231
private ChartRenderingInfo chartinfo = null ;
0 commit comments