@@ -60,7 +60,7 @@ public static void main(String[] args) throws ClassNotFoundException, SQLExcepti
6060 System .out .println ("| / /__(__ )| |/ / __// /_/ / /_/ / __/ |" );
6161 System .out .println ("| \\ ___/____/ |___/____/ .___/\\ __,_/_/ |" );
6262 System .out .println ("| /_/ |" );
63- System .out .println ("| v.1 .0.3 |" );
63+ System .out .println ("| v.2 .0.0 |" );
6464 System .out .println ("·------------------------------------------·" );
6565
6666 Options options = new Options ();
@@ -71,7 +71,7 @@ public static void main(String[] args) throws ClassNotFoundException, SQLExcepti
7171 Option csvSeparatorOption = new Option ("csv_separator" , true , "CSV separator character (optional default ';')" );
7272 csvSeparatorOption .setRequired (false );
7373
74- Option csvExtensionOption = new Option ("csv_extension" , true , "CSV file extesion (optional default '')" );
74+ Option csvExtensionOption = new Option ("csv_extension" , true , "CSV file extension (optional default '')" );
7575 csvExtensionOption .setRequired (false );
7676
7777 Option csvCharsetOption = new Option ("csv_charset" , true , "CSV file charset (optional default 'UTF-8')" );
@@ -92,6 +92,9 @@ public static void main(String[] args) throws ClassNotFoundException, SQLExcepti
9292 Option pdfOption = new Option ("pdf" , true , "PDF output file (optional, use instead -txt)" );
9393 pdfOption .setRequired (false );
9494
95+ Option dpiOption = new Option ("dpi" , true , "PDF output file dpi" );
96+ dpiOption .setRequired (false );
97+
9598 Option txtOption = new Option ("txt" , true , "TXT output file (optional, use instead -pdf)" );
9699 txtOption .setRequired (false );
97100
@@ -110,6 +113,7 @@ public static void main(String[] args) throws ClassNotFoundException, SQLExcepti
110113 options .addOption (ftlFileOption );
111114 options .addOption (ftlEncodingOption );
112115 options .addOption (pdfOption );
116+ options .addOption (dpiOption );
113117 options .addOption (txtOption );
114118 options .addOption (txtCharsetOption );
115119 options .addOption (eachOption );
@@ -130,11 +134,20 @@ public static void main(String[] args) throws ClassNotFoundException, SQLExcepti
130134
131135 String ftlFile = cmd .getOptionValue ("ftl_file" );
132136 String ftlEncoding = cmd .getOptionValue ("ftl_encoding" , "UTF-8" );
133- Configuration cfg = new Configuration (Configuration .VERSION_2_3_30 );
137+ Configuration cfg = new Configuration (Configuration .VERSION_2_3_32 );
134138 cfg .setDirectoryForTemplateLoading (FileSystems .getDefault ().getPath ("." ).toFile ());
135139 cfg .setDefaultEncoding (ftlEncoding );
140+ cfg .setTagSyntax (Configuration .SQUARE_BRACKET_TAG_SYNTAX );
141+ cfg .setInterpolationSyntax (Configuration .SQUARE_BRACKET_INTERPOLATION_SYNTAX );
136142 Template template = cfg .getTemplate (ftlFile );
137- ITextRenderer renderer = cmd .hasOption ("pdf" ) ? new ITextRenderer () : null ;
143+ ITextRenderer renderer = null ;
144+
145+ if (cmd .hasOption ("pdf" )) {
146+ int dpi = Integer .parseInt (cmd .getOptionValue ("dpi" ,"96" ));
147+ float dotsPerPoint = ((float ) dpi / 72.0f );
148+ int dotsPerPixel = 1 ;
149+ renderer = new ITextRenderer (dotsPerPoint ,dotsPerPixel );
150+ }
138151
139152 if (cmd .hasOption ("for_each" )) {
140153 for (HashMap <String , Object > row : rows ) {
0 commit comments