Example usage for com.itextpdf.text Document addCreator

List of usage examples for com.itextpdf.text Document addCreator

Introduction

In this page you can find the example usage for com.itextpdf.text Document addCreator.

Prototype


public boolean addCreator(String creator) 

Source Link

Document

Adds the creator to a Document.

Usage

From source file:com.photoshop.misc.Indexkaartgenerator.java

private void addMetaData(Document document) {
    document.addTitle("Indexkaart: " + order.getId()); //Moet order nummer uit database worden
    document.addAuthor("Fotowinkel"); // naam fotograaf
    document.addCreator("Fotowinkel");
}

From source file:com.planning.project.controller.CreatePDF.java

private static void addMetaData(Document document) {
    document.addTitle("Generate PDF report");
    document.addSubject("Generate PDF report");
    document.addAuthor("Java Honk");
    document.addCreator("Java Honk");
}

From source file:com.preselect.pdfservice.tasks.PdfConversionTask.java

License:Open Source License

private static void copyDocument(PdfReader reader, int start, int end, String path, OutlineItems outline)
        throws IOException, DocumentException {
    Document document = new Document();
    PdfSmartCopy copy = new PdfSmartCopy(document, new FileOutputStream(path));

    document.open();//from www .  jav a 2 s. co m
    for (int i = (start - 1); i <= (end - 1);) {
        copy.addPage(copy.getImportedPage(reader, ++i));
    }
    List<OutlineItem> outlineForChapter = getOutlineBetweenPages(outline, start, end);
    Iterator<OutlineItem> iterator = outlineForChapter.iterator();
    if (iterator.hasNext()) {
        List<HashMap<String, Object>> bookmarksForChapter = getBookmarks(iterator.next(), iterator, 1);
        SimpleBookmark.shiftPageNumbers(bookmarksForChapter, (-start + 1), null);
        copy.setOutlines(bookmarksForChapter);
    }
    if (outlineForChapter.size() > 0) {
        OutlineItem firstOutline = outlineForChapter.get(0);
        document.addTitle(firstOutline.getTitle());
    }
    document.addCreator("Content Select");
    document.close();
    copy.close();
}

From source file:com.sarav.donormgmttool.EmailWithPdf.java

/**
 * Writes the content of a PDF file (using iText API)
 * to the {@link OutputStream}.//w w  w  .  j  a v a2 s .c o  m
 * @param outputStream {@link OutputStream}.
 * @throws Exception
 */
public void writePdf(OutputStream outputStream) throws Exception {
    Document document = new Document();
    PdfWriter.getInstance(document, outputStream);

    document.open();

    document.addTitle("Test PDF");
    document.addSubject("Testing email PDF");
    document.addKeywords("iText, email");
    document.addAuthor("Jee Vang");
    document.addCreator("Jee Vang");

    Paragraph paragraph = new Paragraph();
    paragraph.add(new Chunk("hello!"));
    document.add(paragraph);

    document.close();
}

From source file:com.sarav.donormgmttool.SendMail.java

public void writePdf(OutputStream outputStream, float ramount, java.sql.Date rdate, int rnum, String rname,
        String rmode) throws Exception {

    Document document = new Document();

    //step2 http://developers.itextpdf.com/examples/xml-worker-itext5/html-tables
    PdfWriter writer = PdfWriter.getInstance(document, outputStream);

    String PDFContent = "<center>\n" + "        <table style=\"text-align:center\">\n" + "            <tr>\n"
            + "                <td>\n"
            + "                    <img src=\"Images/Small - Team Everest Logo.png\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n"
            + "                </td>\n" + "                <td>\n"
            + "                    <h1 style=\"font-family: Arial\"><b><u>Team Everest</u></b></h1><b>(Regd No: 2292/09)</b>\n"
            + "                    <p style=\"font-family: Times\"> 5/1B, Magaveerar Street, Arnipalayam, Arni  632301<br>\n"
            + "                        Tiruvannamalai Dt, Tamilnadu, India Phone: +91 89399 12365<br>\n"
            + "                        Email: info@teameverestindia.org   Website: www.teameverestindia.org</p>\n"
            + "                </td>\n" + "            </tr>\n"
            + "            <tr><td><br><br><br><br></td></tr>\n" + "            <tr>\n"
            + "                <td>\n" + "                    <b>Reciept No:</b>*********\n"
            + "                </td>\n" + "                <td>\n"
            + "                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n"
            + "                </td>\n" + "                <td>\n"
            + "                    <b>Date:</b>********\n" + "                </td>\n" + "            </tr>\n"
            + "            <tr><td><br><br><br><br></td></tr>\n" + "            <tr>\n"
            + "                <td></td>\n" + "                <td>\n"
            + "                    <p style=\"font-family: Times\">Received the sum of Rs. <b>*****/- (*******)</b>, with thanks from\n"
            + "                        <b>*******</b>  as donation for Team Everest.</p>\n"
            + "                </td>\n" + "            </tr>\n"
            + "            <tr><td><br><br><br><br></td></tr>\n" + "            <tr>\n"
            + "                <td></td>\n" + "                <td>\n"
            + "                    <p style=\"text-align:left\"><b>Amount:</b> Rs.********&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Mode of Donation:</b>********</p>\n"
            + "                </td>\n" + "            </tr>\n"
            + "            <tr><td><br><br><br><br></td></tr>\n" + "            <tr><td><br><br><br><br></td>\n"
            + "                <td style=\"text-align:right\">\n"
            + "                    <p>For Team Everest&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>\n"
            + "                    <img src =\"Images/Signature.JPG\">\n" + "                </td>\n"
            + "            </tr>\n" + "            <tr><td><br><br><br><br></td></tr>\n" + "            <tr>\n"
            + "                <td></td>\n" + "                <td>\n"
            + "                    <p>*Donations are exempted under 80G of Income Tax Act<br>\n"
            + "                       1961 C, No. DIT (E) No. 2 (19) 1011. Pan No: AABTT6850G.</p>\n"
            + "                </td>\n" + "            </tr>\n" + "        </table>\n" + "        </center>";
    document.open();// w  w  w  .  j  av  a2s .c om

    document.addTitle("EReceipt");
    document.addSubject("EreceiptPDF");
    document.addKeywords("iText, email");
    document.addAuthor("AKSarav");
    document.addCreator("AkSarav");

    //HTMLWorker htmlworker = new HTMLWorker(document);

    StringBuilder contentBuilder = new StringBuilder();
    Paragraph paragraph = new Paragraph();

    //System.out.println("PDFCONTENT"+PDFContent);
    contentBuilder.append(PDFContent);

    //HTML Processor
    HtmlPipelineContext htmlContext = new HtmlPipelineContext(null);
    htmlContext.setTagFactory(Tags.getHtmlTagProcessorFactory());
    // Pipelines
    PdfWriterPipeline pdf = new PdfWriterPipeline(document, writer);
    HtmlPipeline html = new HtmlPipeline(htmlContext, pdf);

    //XMLWorker
    XMLWorker worker = new XMLWorker(html, true);
    XMLParser p = new XMLParser(worker);
    p.parse(new ByteArrayInputStream(contentBuilder.toString().getBytes()));

    // Closing the document

    document.close();
}

From source file:com.shashi.itext.write.FirstPdf.java

private static void addMetaData(Document document) {
    document.addTitle("My first PDF");
    document.addSubject("Using iText");
    document.addKeywords("Java, PDF, iText");
    document.addAuthor("Lars Vogel");
    document.addCreator("Lars Vogel");

}

From source file:com.softwaremagico.tm.pdf.complete.PdfDocument.java

License:Open Source License

protected Document addMetaData(Document document) {
    document.addTitle("Fading Suns Character Sheet");
    document.addAuthor("Software Magico");
    document.addCreator("Think Machine");
    document.addSubject("RPG");
    document.addKeywords("RPG, Fading Suns, FS, " + language);
    document.addCreationDate();//  w ww . ja  va2 s . c o  m
    return document;
}

From source file:com.solidmaps.webapp.report.EnableCompanyRequerimentFederalPDF.java

private String createDocument(Document doc, PdfWriter docWriter, LicensePFEntity license)
         throws FileNotFoundException, DocumentException {

     String fileName = "Requerimento de Habilitao de PJ - Cnpj: " + license.getCompany().getCnpj() + ".pdf";

     docWriter = PdfWriter.getInstance(doc, new FileOutputStream(filePath + fileName));

     // document header attributes
     doc.addAuthor("EnforceMaps");
     doc.addCreationDate();//from   w  w w .ja v a2  s . com
     doc.addProducer();
     doc.addCreator("EnforceMaps");
     doc.addTitle("Requerimento de Habilitao de PJ");
     doc.setPageSize(PageSize.A4);

     // open document
     doc.open();

     return fileName;
 }

From source file:com.solidmaps.webapp.report.LicenseCivilIncludeProductPDF.java

License:Open Source License

private String createDocument(Document doc, PdfWriter docWriter, LicensePCEntity license, String type)
        throws FileNotFoundException, DocumentException {

    String fileName = "Requerimento de " + type + " Licensa: " + license.getCompany().getCnpj() + ".pdf";

    docWriter = PdfWriter.getInstance(doc, new FileOutputStream(filePath + fileName));

    // document header attributes
    doc.addAuthor("EnforceMaps");
    doc.addCreationDate();//from www  .  j  ava  2  s .c  om
    doc.addProducer();
    doc.addCreator("EnforceMaps");
    doc.addTitle("Requerimento de " + type + " Licensa: " + license.getCompany().getCnpj());
    doc.setPageSize(PageSize.A4);

    // open document
    doc.open();

    return fileName;
}

From source file:com.solidmaps.webapp.report.MapCivilPdfGenerator.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("EnforceMaps");
    doc.addCreationDate();/*from ww  w .j  av a 2 s  . com*/
    doc.addProducer();
    doc.addCreator("EnforceMaps");
    doc.addTitle("Mapa de Produtos Controlados: " + company.getCnpjFormatted());
    doc.setPageSize(PageSize.A4.rotate());

    // open document
    doc.open();

    return fileName;
}