-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloWorld.java
More file actions
29 lines (24 loc) · 756 Bytes
/
HelloWorld.java
File metadata and controls
29 lines (24 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.pdf.ravishankarcode;
import java.io.FileNotFoundException;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Paragraph;
/**
*
* @author Ravishankar.kumar
*
*/
public class HelloWorld
{
public static final String DEST = "C:\\temp\\hello.pdf";
public static void main( String[] args ) throws FileNotFoundException
{
PdfDocument pdf = new PdfDocument(new PdfWriter(DEST));
Document document = new Document(pdf);
String line = "Hello! Welcome to iTextPdf";
document.add(new Paragraph(line));
document.close();
System.out.println("Awesome PDF just got created.");
}
}