Package com.lowagie.text

Examples of com.lowagie.text.LwgDocument.open()


               document.newPage();
            }

            else
            {
               document.open();
            }

            img.setAbsolutePosition(0, 0);
            document.add(img);
View Full Code Here


                    document = new LwgDocument(reader.getPageSizeWithRotation(1));
                    // step 2: we create a writer that listens to the document
                    writer = new PdfCopy(document,
                                         new FileOutputStream(pdf_file));
                    // step 3: we open the document
                    document.open();
                }
                // step 4: we add content
                PdfImportedPage page;
                for (int p = 0; p < n; ) {
                    ++p;
View Full Code Here

              // step 1: creation of a document-object
              document = new LwgDocument(reader.getPageSizeWithRotation(pagenumber));
        // step 2: we create a writer that listens to the document
              PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(new File(directory, name + filename)));
              // step 3: we open the document
              document.open();
              PdfContentByte cb = writer.getDirectContent();
        PdfImportedPage page = writer.getImportedPage(reader, pagenumber);
        int rotation = reader.getPageRotation(pagenumber);
        if (rotation == 90 || rotation == 270) {
          cb.addTemplate(page, 0, -1f, 1f, 0, 0, reader.getPageSizeWithRotation(pagenumber).getHeight());
View Full Code Here

      LwgDocument document = new LwgDocument(newSize, 0, 0, 0, 0);
      // step 2: we create a writer that listens to the document
      PdfWriter writer = PdfWriter.getInstance(document,
          new FileOutputStream(dest));
      // step 3: we open the document
      document.open();
      // step 4: adding the content
      PdfContentByte cb = writer.getDirectContent();
      PdfImportedPage page;
      float offsetX, offsetY;
      int p;
View Full Code Here

        PdfWriter writer1 = PdfWriter.getInstance(document1, new FileOutputStream(args[1]));
        PdfWriter writer2 = PdfWriter.getInstance(document2, new FileOutputStream(args[2]));
        // step 3: we open the document
        document1.open();
        PdfContentByte cb1 = writer1.getDirectContent();
        document2.open();
        PdfContentByte cb2 = writer2.getDirectContent();
        PdfImportedPage page;
        int rotation;
        int i = 0;
        // step 4: we add content
View Full Code Here

      // step 1: creation of a document-object
      LwgDocument document = new LwgDocument(newSize, 0, 0, 0, 0);
      // step 2: we create a writer that listens to the document
      PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(dest));
      // step 3: we open the document
      document.open();
      // step 4: adding the content
      PdfContentByte cb = writer.getDirectContent();
      PdfImportedPage page;
      float offsetX, offsetY, factor;
      int p;
View Full Code Here

                        // step 1: creation of a document-object
                        document = new LwgDocument(reader.getPageSizeWithRotation(1));
                        // step 2: we create a writer that listens to the document
                        writer = new PdfCopy(document, new FileOutputStream(outFile));
                        // step 3: we open the document
                        document.open();
                    }
                    // step 4: we add content
                    PdfImportedPage page;
                    for (int i = 0; i < n; ) {
                        ++i;
View Full Code Here

        // step 1: creation of a document-object
        LwgDocument document = new LwgDocument(LwgPageSize.A4);
        // step 2: we create a writer that listens to the document
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(args[1]));
        // step 3: we open the document
        document.open();
        PdfContentByte cb = writer.getDirectContent();
        PdfImportedPage page;
        int rotation;
        int i = 0;
        int p = 0;
View Full Code Here

            // and directs a PDF-stream to a file
          if (getValue("destfile") == null) throw new DocumentException("You must provide a destination file!");
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream((File)getValue("destfile")));

            // step 3: we open the document
            document.open();

            // step 4:
          PdfContentByte cb = writer.getDirectContent();
            if (getValue("title") != null) {
              cb.setFontAndSize(BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, false), 24);
View Full Code Here

            // and directs a PDF-stream to a file
           
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("NewPage.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4:
            document.add(new Paragraph("This is the first page."));
            document.newPage();
            document.add(new Paragraph("This is a new page"));
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.