File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
itext-java-pdf-table/src/main/java/com/hmkcode Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .hmkcode ;
2+
3+ import java .io .FileNotFoundException ;
4+ import java .io .FileOutputStream ;
5+
6+ import com .itextpdf .text .Document ;
7+ import com .itextpdf .text .DocumentException ;
8+ import com .itextpdf .text .PageSize ;
9+ import com .itextpdf .text .pdf .PdfWriter ;
10+
11+
12+ public class App
13+ {
14+ public static void main ( String [] args ) throws FileNotFoundException , DocumentException
15+ {
16+ // step 1
17+ Document document = new Document ();
18+ document .setPageSize (PageSize .A4 );
19+
20+ // step 2
21+ PdfWriter .getInstance (document , new FileOutputStream ("pdf.pdf" ));
22+
23+ // step 3
24+ document .open ();
25+
26+ // step 4 create PDF contents
27+ document .add (TableBuilder .createTable ());
28+
29+ //step 5
30+ document .close ();
31+
32+ System .out .println ( "PDF Created!" );
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments