Package com.lowagie.text

Examples of com.lowagie.text.Document.newPage()


               
                //run PrinterEngine's print function
                engine.print(graphics, pageFormat, 0);
                 
                graphics.dispose();
                document.newPage();
                if (i == 0) {
                    numPages = template.getNumPages();
                }
                i++;
               
View Full Code Here


        PdfContentByte cb = writer.getDirectContent();

        int i = 0;
        while (i < n) {
            i++;
            document.newPage();
            PdfImportedPage page = writer.getImportedPage(reader, i);
            cb.addTemplate(page, factor, 0, 0, factor, left, down);
        }

        document.close();
View Full Code Here

        try {
          Image imgOdd = TiffImage.getTiffImage(odd, c + 1);
          Image imgEven = TiffImage.getTiffImage(even, count - c);
          document.setPageSize(new Rectangle(imgOdd.scaledWidth(),
              imgOdd.scaledHeight()));
          document.newPage();
          imgOdd.setAbsolutePosition(0, 0);
          cb.addImage(imgOdd);
          document.setPageSize(new Rectangle(imgEven.scaledWidth(),
              imgEven.scaledHeight()));
          document.newPage();
View Full Code Here

          document.newPage();
          imgOdd.setAbsolutePosition(0, 0);
          cb.addImage(imgOdd);
          document.setPageSize(new Rectangle(imgEven.scaledWidth(),
              imgEven.scaledHeight()));
          document.newPage();
          imgEven.setAbsolutePosition(0, 0);
          cb.addImage(imgEven);

        } catch (Exception e) {
          System.out.println("Exception page " + (c + 1) + " "
View Full Code Here

        }
      }
      while (i < n) {
        i++;
        document2.setPageSize(reader.getPageSizeWithRotation(i));
        document2.newPage();
        page = writer2.getImportedPage(reader, i);
        rotation = reader.getPageRotation(i);
        if (rotation == 90 || rotation == 270) {
          cb2.addTemplate(page, 0, -1f, 1f, 0, 0, reader.getPageSizeWithRotation(i).height());
        }
View Full Code Here

      PdfImportedPage page;
      float offsetX, offsetY, factor;
      int p;
      for (int i = 0; i < total; i++) {
        if (i % n == 0) {
          document.newPage();
        }
        p = i + 1;
        offsetX = unitSize.width() * ((i % n) % c);
        offsetY = newSize.height() - (unitSize.height() * (((i % n) / c) + 1));
        currentSize = reader.getPageSize(p);
View Full Code Here

      for (int i = 0; i < total; i++) {
        p = i + 1;
        pageSize = reader.getPageSize(p);
        newSize = new Rectangle(pageSize.width() / 2, pageSize.height());

        document.newPage();
        offsetX = 0;
        offsetY = 0;
        page = writer.getImportedPage(reader, p);
        cb.addTemplate(page, 1, 0, 0, 1, offsetX, offsetY);
        document.newPage();
View Full Code Here

        document.newPage();
        offsetX = 0;
        offsetY = 0;
        page = writer.getImportedPage(reader, p);
        cb.addTemplate(page, 1, 0, 0, 1, offsetX, offsetY);
        document.newPage();
        offsetX = -newSize.width();
        offsetY = 0;
        page = writer.getImportedPage(reader, p);
        cb.addTemplate(page, 1, 0, 0, 1, offsetX, offsetY);
View Full Code Here

                        img.scalePercent(7200f / img.getDpiX(), 7200f / img.getDpiY());
                    }
                  if (adjustSize) {
              document.setPageSize(new Rectangle(img.scaledWidth(),
                  img.scaledHeight()));
                        document.newPage();
                    img.setAbsolutePosition(0, 0);
                  }
                  else {
                    if (img.scaledWidth() > width || img.scaledHeight() > height) {
                            if (img.getDpiX() > 0 && img.getDpiY() > 0) {
View Full Code Here

                            }
                            else
                                img.scaleToFit(width, height);
                    }
                    img.setAbsolutePosition(20, 20);
                        document.newPage();
                        document.add(new Paragraph(tiff_file + " - page " + (c + 1)));
                  }
                    cb.addImage(img);
                    System.out.println("Finished page " + (c + 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.