3
3
import java .io .ByteArrayOutputStream ;
4
4
import java .io .OutputStream ;
5
5
6
+ import org .fugerit .java .core .cfg .ConfigException ;
6
7
import org .fugerit .java .doc .base .config .DocInput ;
7
8
import org .fugerit .java .doc .base .config .DocOutput ;
8
9
import org .fugerit .java .doc .base .config .DocTypeHandler ;
9
10
import org .fugerit .java .doc .base .config .DocTypeHandlerDefault ;
10
11
import org .fugerit .java .doc .base .model .DocBase ;
12
+ import org .fugerit .java .doc .mod .openpdf .helpers .OpenPDFConfigHelper ;
11
13
import org .fugerit .java .doc .mod .openpdf .helpers .OpenPpfDocHandler ;
12
14
13
15
import com .lowagie .text .Document ;
14
16
import com .lowagie .text .PageSize ;
15
17
import com .lowagie .text .rtf .RtfWriter2 ;
18
+ import org .w3c .dom .Element ;
16
19
17
20
public class RtfTypeHandler extends DocTypeHandlerDefault {
18
21
@@ -34,7 +37,7 @@ public void handle(DocInput docInput, DocOutput docOutput) throws Exception {
34
37
String [] margins = docBase .getInfo ().getProperty ( "margins" , "20;20;20;20" ).split ( ";" );
35
38
Document document = new Document ( PageSize .A4 , Integer .parseInt ( margins [0 ] ),
36
39
Integer .parseInt ( margins [1 ] ),
37
- Integer .parseInt ( margins [2 ] ),
40
+ Integer .parseInt ( margins [2 ] ),
38
41
Integer .parseInt ( margins [3 ] ) );
39
42
ByteArrayOutputStream baos = new ByteArrayOutputStream ();
40
43
RtfWriter2 rtfWriter2 = RtfWriter2 .getInstance ( document , baos );
@@ -45,4 +48,10 @@ public void handle(DocInput docInput, DocOutput docOutput) throws Exception {
45
48
outputStream .close ();
46
49
}
47
50
51
+ @ Override
52
+ protected void handleConfigTag (Element config ) throws ConfigException {
53
+ super .handleConfigTag (config );
54
+ OpenPDFConfigHelper .handleConfig ( config , this .getType () );
55
+ }
56
+
48
57
}
0 commit comments