import java.io.FileOutputStream;
import com.lowagie.text.Document;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;
public class MainClass {
public static void main(String[] args) throws Exception {
Document document = new Document();
PdfWriter writer4 = PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
writer4.setViewerPreferences(PdfWriter.HideToolbar | PdfWriter.PageModeUseThumbs);
document.addTitle("Hello World");
document.open();
Paragraph hello = new Paragraph("(English:) hello, ");
document.add(new Paragraph("asdf"));
document.add(hello);
document.close();
}
}
|