Package com.lowagie.text

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


      document.add(table);
      document.add(table);
      document.add(new Paragraph("They are glued to eachother"));
      document.add(table);
      document.add(new Paragraph("This is not very nice. Turn to the next page to see how we solved this"));
      document.newPage();
      document.add(new Paragraph("We add 2 tables, but with a certain 'SpacingBefore':"));
      table.setSpacingBefore(15f);
      document.add(table);
      document.add(table);
      document.add(new Paragraph("Unfortunately, there was no spacing after."));
View Full Code Here


            cb.addTemplate(template, 0, 1, -1, 0, 200, 600);
            cb.addTemplate(template, .5f, 0, 0, .5f, 100, 400);
            cb.sanityCheck();
           
            // we go to a new page
            document.newPage();
            cb.addTemplate(template, 0, 500);
            cb.addTemplate(template, 2, 0, -1, 2, 200, 300);
            cb.sanityCheck();
        }
        catch(DocumentException de) {
View Full Code Here

                                img.scaleToFit(500, 700);
                            }
                            img.setAbsolutePosition(20, 20);
                            document.add(new Paragraph(tiff_file + " - page " + (c + 1)));
                            cb.addImage(img);
                            document.newPage();
                            ++pages;
                        }
                    }
                    catch (Throwable e) {
                        System.out.println("Exception " + tiff_file + " page " + (c + 1) + " " + e.getMessage());
View Full Code Here

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

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

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

            // only for DocumentB.pdf:
            writerA.pause();
            document.add(p3b);
            document.add(p2);
            document.add(p2);
            document.newPage();
            document.add(p2);
            document.add(p2);
            document.newPage();
            writerA.resume();
            // only for documentA.pdf
View Full Code Here

            document.add(p2);
            document.add(p2);
            document.newPage();
            document.add(p2);
            document.add(p2);
            document.newPage();
            writerA.resume();
            // only for documentA.pdf
            writerB.pause();
            document.add(p3a);
            writerB.resume();
View Full Code Here

            g2.setClip(oldClip);
           
            g2.dispose();
            cb.restoreState();
           
            document.newPage();
           
            // Create the graphics with pdf fonts
            cb.saveState();
            g2 = cb.createGraphics(500, 500);
           
View Full Code Here

      for (int k = 1; k <= 10; ++k) {
        document.add(new Paragraph("This is page " + k));
        document.add(Chunk.NEWLINE);
        document.add(table);
        document.add(p);
        document.newPage();
      }
    } catch (Exception de) {
      de.printStackTrace();
    }
View Full Code Here

            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("LocalDestination.pdf"));
            // step 3: we open the document
            document.open();
            // step 4: we add some content
            document.add(new Paragraph("Page 1"));
            document.newPage();
            document.add(new Paragraph("This PDF file jumps directly to page 2 when opened"));
            PdfContentByte cb = writer.getDirectContent();
            cb.localDestination("page2", new PdfDestination(PdfDestination.XYZ, -1, 10000, 0));
            writer.setOpenAction("page2");
        }
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.