Package com.itextpdf.text

Examples of com.itextpdf.text.Document.open()


        xmp.close();

        writer.setXmpMetadata(os.toByteArray());
        // step 3
        document.open();
        // step 4
        document.add(new Paragraph("Hello World"));
        // step 5
        document.close();
View Full Code Here


        document.addKeywords("Metadata, iText, step 3");
        document.addCreator("My program using 'iText'");
        document.addAuthor("Bruno Lowagie & Paulo Soares");
        writer.createXmpMetadata();
        // step 3
        document.open();
        // step 4
        document.add(new Paragraph("Hello World"));
        // step 5
        document.close();
        CompareTool ct = new CompareTool();
View Full Code Here

        pdf.setProperty(PdfSchema.VERSION, "1.4");
        xmp.addRdfDescription(pdf);
        xmp.close();
        writer.setXmpMetadata(os.toByteArray());
        // step 3
        document.open();
        // step 4
        document.add(new Paragraph("Hello World"));
        // step 5
        document.close();
        CompareTool ct = new CompareTool();
View Full Code Here

  }

  private void createPdfDocumentFileFromTIFF(File tiffFile, File pdfFile) throws Exception {
    Document document = new Document(PageSize.A4, 0.0f, 0.0f, 0.0f, 0.0f);
    PdfWriter.getInstance(document, new FileOutputStream(pdfFile));
    document.open();
    RandomAccessFileOrArray ra = new RandomAccessFileOrArray(tiffFile.getCanonicalPath());
    int pageCount = TiffImage.getNumberOfPages(ra);
    for (int i = 0; i < pageCount; ++i) {
      Image img = TiffImage.getTiffImage(ra, i + 1);
      if (img != null) {
View Full Code Here

  }

  private void createPdfDocumentFileFromSingleImageFile(File imageFile, File pdfFile) throws Exception {
    Document document = new Document(PageSize.A4, 0.0f, 0.0f, 0.0f, 0.0f);
    PdfWriter.getInstance(document, new FileOutputStream(pdfFile));
    document.open();
    Image image = Image.getInstance(imageFile.getCanonicalPath());
    image.scaleToFit(PageSize.A4.getWidth(), PageSize.A4.getHeight());
    document.add(image);
    document.close();
  }
View Full Code Here

  }

  private void createPdfDocumentFileFromTIFF(File tiffFile, File pdfFile) throws Exception {
    Document document = new Document(PageSize.A4, 0.0f, 0.0f, 0.0f, 0.0f);
    PdfWriter.getInstance(document, new FileOutputStream(pdfFile));
    document.open();
    RandomAccessFileOrArray ra = new RandomAccessFileOrArray(tiffFile.getCanonicalPath());
    int pageCount = TiffImage.getNumberOfPages(ra);
    for (int i = 0; i < pageCount; ++i) {
      God.appWindow.getStatusBar().setInitProgress(i, pageCount);
      Image img = TiffImage.getTiffImage(ra, i + 1);
View Full Code Here

  }

  private void createPdfDocumentFileFromSingleImageFile(File imageFile, File pdfFile) throws Exception {
    Document document = new Document(PageSize.A4, 0.0f, 0.0f, 0.0f, 0.0f);
    PdfWriter.getInstance(document, new FileOutputStream(pdfFile));
    document.open();
    Image image = Image.getInstance(imageFile.getCanonicalPath());
    image.scaleToFit(PageSize.A4.getWidth(), PageSize.A4.getHeight());
    document.add(image);
    document.close();
  }
View Full Code Here

    Document document = new Document(r);
    try {
      PdfWriter writer;
      writer = PdfWriter.getInstance(document, new FileOutputStream(
          filepath));
      document.open();
      PdfContentByte cb = writer.getDirectContent();
      PdfTemplate tp = cb.createTemplate(graphContainer.getWidth(),
          graphContainer.getHeight());
      Graphics2D g2d = tp.createGraphics(graphContainer.getWidth(),
          graphContainer.getHeight(), new DefaultFontMapper());
View Full Code Here

    OutputStream out = new FileOutputStream(filename);
    try {
      PdfWriter writer = PdfWriter.getInstance(document, out);
      document.addAuthor("Daniel Velten");
      document.addTitle(title);
      document.open();
     
      for (JFreeChart chart : charts) {
        addChartToPDF(chart, rect, writer);       
        document.newPage();
      }
View Full Code Here

    OutputStream out = new FileOutputStream(filename);
    try {
      PdfWriter writer = PdfWriter.getInstance(document, out);
      document.addAuthor("Daniel Velten");
      document.addTitle(title);
      document.open();
     
      for (int i=0; i<2;i++) {
        addChartToPDF2(charts1.get(i), writer, 1-i, 0);       
        addChartToPDF2(charts2.get(i), writer, 1-i, 1);       
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.