| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- /**
- *
- */
- package test;
- import java.io.File;
- import java.io.FileOutputStream;
- import java.util.Date;
- //import com.itextpdf.text.Document;
- //import com.itextpdf.text.Paragraph;
- //import com.itextpdf.text.pdf.PdfWriter;
- /**
- * @author xzx
- *
- * 2019年5月5日
- *
- */
- public class GeneratePDF {
- /* private static String USER_PASS = "123";
- private static String OWNER_PASS = "321";
- public static void main(String[] args) {
- try {
- FileOutputStream file = new FileOutputStream(new File("D:\\Test1.pdf"));
- Document document = new Document();
- PdfWriter writer = PdfWriter.getInstance(document, file);
- // writer.setEncryption(USER_PASS.getBytes(), OWNER_PASS.getBytes(),
- // PdfWriter.ALLOW_PRINTING, PdfWriter.ENCRYPTION_AES_128);
- document.open();
- document.add(new Paragraph("Hello World, iText2222222222"));
- document.add(new Paragraph(new Date().toString()));
- document.close();
- file.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }*/
- }
|