Package com.lowagie.text

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


            aTable.addCell("1.3", new Point(1,3));
            document.add(aTable);
      document.add(new Paragraph("converted to PdfPTable:"));
      aTable.setConvert2pdfptable(true);
      document.add(aTable);
            document.newPage();    
            aTable = new Table(4,4);    // 4 rows, 4 columns
            aTable.setAlignment(Element.ALIGN_CENTER);
            aTable.addCell("2.2", new Point(2,2));
            aTable.addCell("3.3", new Point(3,3));
            aTable.addCell("2.1", new Point(2,1));
View Full Code Here


            aTable.addCell("5.0", new Point(5,0))
            document.add(aTable);
      document.add(new Paragraph("converted to PdfPTable:"));
      aTable.setConvert2pdfptable(true);
      document.add(aTable);
            document.newPage();
            aTable = new Table(2,2);    // 2 rows, 2 columns
            aTable.setAlignment(Element.ALIGN_LEFT);
            aTable.setAutoFillEmptyCells(true);
            aTable.addCell("0.0");
            aTable.addCell("0.1");
View Full Code Here

            cb.moveTo(100f, 200f);
            cb.lineTo(200f, 250f);
            cb.lineTo(400f, 150f);
            cb.fill();
            // cb.sanityCheck is called during newPage().
            document.newPage();
            String text = "Some text to show";
            document.add(new Paragraph(text, new Font(Font.HELVETICA, 24, Font.NORMAL, new SpotColor(spc_cmyk, 0.25f))));
            document.add(new Paragraph(text, new Font(Font.HELVETICA, 24, Font.NORMAL, new SpotColor(spc_cmyk, 0.5f))));
           
            // example with template
View Full Code Here

      Chunk chunk = new Chunk("quick brown fox jumps over the lazy dog ");
      for (int i = 0; i < 5; i++) {
        chunk.setTextRenderMode(PdfContentByte.TEXT_RENDER_MODE_STROKE, 0.3f, new Color(i * 30, i * 30, i * 30));
        document.add(chunk);
      }
      document.newPage();
      Phrase p = new Phrase(16f);
      for (int i = 0; i < 5; i++) {
        chunk = new Chunk("quick brown fox jumps over the lazy dog ");
        chunk.setTextRenderMode(PdfContentByte.TEXT_RENDER_MODE_STROKE, 0.3f, new Color(i * 30, i * 30, i * 30));
        p.add(chunk);
 
View Full Code Here

          Font font = FontFactory.getFont("Helvetica", 10);
          Paragraph p;
          p = new Paragraph("\nVarious border widths and colors\nuseAscender=true, useDescender=true", font);
          document.add(p);
         
          document.newPage();
         
          // page 2
          padding = 2f;
          border = new Rectangle(0f, 0f);
          border.setBorderWidthLeft(1f);
View Full Code Here

          border.setBorderColor(Color.BLACK);
          makeTestPage(tableFont, border, writer, document, padding, true, true);
          p = new Paragraph("More typical use - padding of 2\nuseBorderPadding=true, useAscender=true, useDescender=true", font);
          document.add(p);
         
          document.newPage();
         
          // page 3
          padding = 0f;
          border = new Rectangle(0f, 0f);
          border.setBorderWidthLeft(1f);
View Full Code Here

          border.setBorderColor(Color.BLACK);
          makeTestPage(tableFont, border, writer, document, padding, false, true);
          p = new Paragraph("\nuseBorderPadding=true, useAscender=false, useDescender=true", font);
          document.add(p);
         
          document.newPage();
         
          // page 4
          padding = 0f;
          border = new Rectangle(0f, 0f);
          border.setBorderWidthLeft(1f);
View Full Code Here

          border.setBorderColor(Color.BLACK);
          makeTestPage(tableFont, border, writer, document, padding, false, false);
          p = new Paragraph("\nuseBorderPadding=true, useAscender=false, useDescender=false", font);
          document.add(p);
         
          document.newPage();
         
          // page 5
          padding = 0f;
          border = new Rectangle(0f, 0f);
          border.setBorderWidthLeft(1f);
View Full Code Here

      HyphenationAuto auto = new HyphenationAuto("en", "GB", 2, 2);
      ck.setHyphenation(auto);
      Paragraph p = new Paragraph(ck);
      p.setAlignment(Paragraph.ALIGN_JUSTIFIED);
      document.add(p);
      document.newPage();
      ck = new Chunk(text);
      auto = new HyphenationAuto("en", "US", 2, 2);
      ck.setHyphenation(auto);
      p = new Paragraph(ck);
      p.setAlignment(Paragraph.ALIGN_JUSTIFIED);
View Full Code Here

      SAXParser parser = SAXParserFactory.newInstance().newSAXParser();

      // step 4: we parse the document
      parser.parse("playRomeoJuliet.xml", new Events().getXmlHandler(document));

      document.newPage();
      Speaker speaker;
      for (Iterator i = events.getSpeakers().iterator(); i.hasNext();) {
        speaker = (Speaker) i.next();
        document.add(new Paragraph(speaker.getName() + ": "
            + speaker.getOccurrence() + " speech blocks"));
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.