List of usage examples for com.itextpdf.text Document addCreator
public boolean addCreator(String creator)
From source file:com.solidmaps.webapp.report.MapExercitoPdfGenerator.java
License:Open Source License
private String createDocument(Document doc, PdfWriter docWriter) throws FileNotFoundException, DocumentException { String fileName = "Mapa - " + company.getCnpj() + " - " + mapProduct.getNumTrimester() + " " + mapProduct.getYear() + ".pdf"; docWriter = PdfWriter.getInstance(doc, new FileOutputStream(filePath + fileName)); // document header attributes doc.addAuthor("Solid Maps"); doc.addCreationDate();/*from www . j av a2s .c om*/ doc.addProducer(); doc.addCreator("solidmaps"); doc.addTitle("Mapa de Produtos Controlados: " + company.getCnpjFormatted()); doc.setPageSize(PageSize.A4.rotate()); // open document doc.open(); return fileName; }
From source file:com.solidmaps.webapp.report.RenovationRequireExercitoPDF.java
private String createDocument(Document doc, PdfWriter docWriter, LicenseEXEntity license) throws FileNotFoundException, DocumentException { String fileName = "REQUERIMENTO PARA CONCESSO E REVALIDAO DE CERTIFICADO DE REGISTRO " + license.getNumRegister() + ".pdf"; docWriter = PdfWriter.getInstance(doc, new FileOutputStream(filePath + fileName)); // document header attributes doc.addAuthor("EnforceMaps"); doc.addCreationDate();/*from ww w .j a va2 s. co m*/ doc.addProducer(); doc.addCreator("EnforceMaps"); doc.addTitle("REQUERIMENTO PARA CONCESSO E REVALIDAO DE CERTIFICADO DE REGISTRO " + license.getNumRegister() + ".pdf"); doc.setPageSize(PageSize.A4); // open document doc.open(); return fileName; }
From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseExercitoPDF.java
private String createDocument(Document doc, PdfWriter docWriter, LicenseEXEntity license) throws FileNotFoundException, DocumentException { String fileName = "REQUERIMENTO PARA APOSTILAMENTO DE CERTIFICADO DE REGISTRO " + license.getNumRegister() + ".pdf"; docWriter = PdfWriter.getInstance(doc, new FileOutputStream(filePath + fileName)); // document header attributes doc.addAuthor("EnforceMaps"); doc.addCreationDate();// w ww . j a v a 2s . co m doc.addProducer(); doc.addCreator("EnforceMaps"); doc.addTitle( "REQUERIMENTO PARA APOSTILAMENTO DE CERTIFICADO DE REGISTRO " + license.getNumRegister() + ".pdf"); doc.setPageSize(PageSize.A4); // open document doc.open(); return fileName; }
From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseFederalPDF.java
private String createDocument(Document doc, PdfWriter docWriter, LicensePFEntity license) throws FileNotFoundException, DocumentException { String fileName = "Comunicado de alterao cadastral - Cnpj: " + license.getCompany().getCnpj() + ".pdf"; docWriter = PdfWriter.getInstance(doc, new FileOutputStream(filePath + fileName)); // document header attributes doc.addAuthor("EnforceMaps"); doc.addCreationDate();/*from ww w . j a v a 2 s . com*/ doc.addProducer(); doc.addCreator("EnforceMaps"); doc.addTitle("Comunicado de alterao cadastral: "); doc.setPageSize(PageSize.A4); // open document doc.open(); return fileName; }
From source file:com.thomasmore.service.PdfCreateServiceImpl.java
public void readPdf() { try {//from w ww .j ava2s . com OutputStream file = new FileOutputStream(new File("D:\\SamplePDFje.pdf")); Document document = new Document(); PdfWriter.getInstance(document, file); document.open(); document.add(new Paragraph("First iText PDF")); document.add(new Paragraph(new Date().toString())); document.addAuthor("Krishna Sfsfsfsn"); document.addCreationDate(); document.addCreator("JavaBeat"); document.addTitle("Sample PDF"); //Create Paragraph Paragraph paragraph = new Paragraph("Title 1", new Font(Font.FontFamily.TIMES_ROMAN, 18, Font.BOLD)); //New line paragraph.add(new Paragraph(" ")); paragraph.add("Test Paragraph"); paragraph.add(new Paragraph(" ")); document.add(paragraph); //Create a table in PDF PdfPTable pdfTable = new PdfPTable(3); PdfPCell cell1 = new PdfPCell(new Phrase("Table Header 1")); cell1.setHorizontalAlignment(Element.ALIGN_CENTER); pdfTable.addCell(cell1); cell1 = new PdfPCell(new Phrase("Table Header 2")); cell1.setHorizontalAlignment(Element.ALIGN_CENTER); pdfTable.addCell(cell1); cell1 = new PdfPCell(new Phrase("Table Header 3")); cell1.setHorizontalAlignment(Element.ALIGN_CENTER); pdfTable.addCell(cell1); pdfTable.setHeaderRows(1); pdfTable.addCell("Row 1 Col 1"); pdfTable.addCell("Row 1 Col 2"); pdfTable.addCell("Row 1 Col 3"); pdfTable.addCell("Row 2 Col 1"); pdfTable.addCell("Row 2 Col 2"); pdfTable.addCell("Row 2 Col 3"); document.add(pdfTable); document.close(); file.close(); } catch (Exception e) { e.printStackTrace(); } }
From source file:com.unicauca.coordinacionpis.managedbean.RegistroFormatoAController.java
public void agregarMetadatos() { // create document and writer Document document = new Document(PageSize.A4); PdfWriter writer;/*ww w .j av a 2 s . co m*/ try { writer = PdfWriter.getInstance(document, new FileOutputStream("D:\\aguaabril2016.pdf")); // add meta-data to pdf document.addAuthor("Memorynotfound"); document.addCreationDate(); document.addCreator("Memorynotfound.com"); document.addTitle("Add meta data to PDF"); document.addSubject("how to add meta data to pdf using itext"); document.addKeywords(metadatosAnteproyectos.getTitulo() + "," + metadatosAnteproyectos.getProfesor()); document.addLanguage(Locale.ENGLISH.getLanguage()); document.addHeader("type", "tutorial, example"); // add xmp meta data writer.createXmpMetadata(); document.open(); document.add(new Paragraph("Add meta-data to PDF using iText")); document.close(); } catch (FileNotFoundException ex) { Logger.getLogger(RegistroOfertaAcademicaController.class.getName()).log(Level.SEVERE, null, ex); } catch (DocumentException ex) { Logger.getLogger(RegistroOfertaAcademicaController.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.util.Imprimir.java
private static void addMetaData(Document document) { document.addTitle("Meu primeiro arquivo PDF"); document.addSubject("Utilizando iText"); document.addKeywords("Java, PDF, iText"); document.addAuthor("Victor Carlo"); document.addCreator("X4VC"); }
From source file:com.VanLesh.macsv10.macs.Models.Pdf.java
License:GNU General Public License
private static void addMetaData(Document doc, Calculation calc) { doc.addTitle(calc.getTitle());//w ww .ja v a 2s .co m doc.addAuthor(calc.getEngineerName()); doc.addSubject(calc.getJobSite() + " This PDF was created using itext, and MACS is subject to" + "the AGPL license"); doc.addCreator("MACS v1.0 using itext"); doc.addKeywords("MACS, itext, PDF"); }
From source file:com.wipro.srs.service.PrintTicket.java
private static void addMetaData(Document document) { document.addTitle("Maverick Ship services "); document.addSubject("Ticket"); document.addAuthor("Maverick Ship services"); document.addCreator("Maverick Ship services"); document.addCreationDate();//from w w w . ja v a 2 s.c o m }
From source file:com.workhub.utils.PDFUtils.java
private static void addMetaData(Document document, String title, String creator) { document.addTitle(title);/*from w ww. ja v a 2 s . c om*/ // document.addSubject("Using iText"); // document.addKeywords("Java, PDF, iText"); // document.addAuthor("Lars Vogel"); document.addCreator(creator); }