Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfLayer


            document.open();
            // step 4
            PdfContentByte cb = writer.getDirectContent();
            LwgPhrase explanation = new LwgPhrase("Layer radio group and zoom", new LwgFont(LwgFont.HELVETICA, 20, LwgFont.BOLD, Color.red));
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, explanation, 50, 650, 0);
            PdfLayer title = PdfLayer.createTitle("Layer radio group", writer);
            PdfLayer l1 = new PdfLayer("Layer 1", writer);
            PdfLayer l2 = new PdfLayer("Layer 2", writer);
            PdfLayer l3 = new PdfLayer("Layer 3", writer);
            PdfLayer l4 = new PdfLayer("Layer 4", writer);
            title.addChild(l1);
            title.addChild(l2);
            title.addChild(l3);
            l4.setZoom(2, -1);
            l4.setOnPanel(false);
            l4.setPrint("Print", true);
            l2.setOn(false);
            l3.setOn(false);
            ArrayList radio = new ArrayList();
            radio.add(l1);
            radio.add(l2);
View Full Code Here


            document.open();
            // step 4: content
            PdfContentByte cb = writer.getDirectContent();
            LwgPhrase explanation = new LwgPhrase("Automatic layers, form fields, images, templates and actions", new LwgFont(LwgFont.HELVETICA, 18, LwgFont.BOLD, Color.red));
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, explanation, 50, 650, 0);
            PdfLayer l1 = new PdfLayer("Layer 1", writer);
            PdfLayer l2 = new PdfLayer("Layer 2", writer);
            PdfLayer l3 = new PdfLayer("Layer 3", writer);
            PdfLayer l4 = new PdfLayer("Form and XObject Layer", writer);
            PdfLayerMembership m1 = new PdfLayerMembership(writer);
            m1.addMember(l2);
            m1.addMember(l3);
            LwgPhrase p1 = new LwgPhrase("Text in layer 1");
            LwgPhrase p2 = new LwgPhrase("Text in layer 2 or layer 3");
View Full Code Here

            document.open();
            // step 4
            PdfContentByte cb = writer.getDirectContent();
            LwgPhrase explanation = new LwgPhrase("Layer grouping", new LwgFont(LwgFont.HELVETICA, 20, LwgFont.BOLD, Color.red));
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, explanation, 50, 650, 0);
            PdfLayer l1 = new PdfLayer("Layer 1", writer);
            PdfLayer l2 = new PdfLayer("Layer 2", writer);
            PdfLayer l3 = new PdfLayer("Layer 3", writer);
            PdfLayerMembership m1 = new PdfLayerMembership(writer);
            m1.addMember(l2);
            m1.addMember(l3);
            LwgPhrase p1 = new LwgPhrase("Text in layer 1");
            LwgPhrase p2 = new LwgPhrase("Text in layer 2 or layer 3");
            LwgPhrase p3 = new LwgPhrase("Text in layer 3");
            cb.beginLayer(l1);
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p1, 50, 600, 0);
            cb.endLayer();
            cb.beginLayer(m1);
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p2, 50, 550, 0);
            cb.endLayer();
            cb.beginLayer(l3);
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p3, 50, 500, 0);
            cb.endLayer();
            cb.sanityCheck();
           
            PdfOCProperties p = writer.getOCProperties();
            PdfArray order = new PdfArray();
            order.add(l1.getRef());
            PdfArray group = new PdfArray();
            group.add(new PdfString("A group of two", PdfObject.TEXT_UNICODE));
            group.add(l2.getRef());
            group.add(l3.getRef());
            order.add(group);
            PdfDictionary d = new PdfDictionary();
            d.put(PdfName.ORDER, order);
            p.put(PdfName.D, d);
            // step 5
View Full Code Here

            document.open();
            // step 4
            PdfContentByte cb = writer.getDirectContent();
            LwgPhrase explanation = new LwgPhrase("Layer nesting", new LwgFont(LwgFont.HELVETICA, 20, LwgFont.BOLD, Color.red));
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, explanation, 50, 650, 0);
            PdfLayer l1 = new PdfLayer("Layer 1", writer);
            PdfLayer l23 = new PdfLayer("Top Layer 2 3", writer);
            PdfLayer l2 = new PdfLayer("Layer 2", writer);
            PdfLayer l3 = new PdfLayer("Layer 3", writer);
            LwgPhrase p1 = new LwgPhrase("Text in layer 1");
            LwgPhrase p2 = new LwgPhrase("Text in layer 2");
            LwgPhrase p3 = new LwgPhrase("Text in layer 3");
            cb.beginLayer(l1);
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p1, 50, 600, 0);
            cb.endLayer();
            cb.beginLayer(l23);
            cb.beginLayer(l2);
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p2, 50, 550, 0);
            cb.endLayer();
            cb.beginLayer(l3);
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p3, 50, 500, 0);
            cb.endLayer();
            cb.endLayer();
            cb.sanityCheck();
           
            PdfOCProperties p = writer.getOCProperties();
            PdfArray order = new PdfArray();
            order.add(l1.getRef());
            order.add(l23.getRef());
            PdfArray group = new PdfArray();
            group.add(l2.getRef());
            group.add(l3.getRef());
            order.add(group);
            PdfDictionary d = new PdfDictionary();
            d.put(PdfName.ORDER, order);
            p.put(PdfName.D, d);
            // step 5
View Full Code Here

      PdfContentByte cb = writer.getDirectContent();
      LwgPhrase explanation = new LwgPhrase("Layer grouping", new LwgFont(
          LwgFont.HELVETICA, 20, LwgFont.BOLD, Color.red));
      ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, explanation, 50,
          650, 0);
      PdfLayer l1 = new PdfLayer("Layer 1", writer);
      PdfLayer l2 = new PdfLayer("Layer 2", writer);
      PdfLayer l3 = new PdfLayer("Layer 3", writer);
      PdfLayerMembership m1 = new PdfLayerMembership(writer);
      m1.addMember(l2);
      m1.addMember(l3);
      LwgPhrase p1 = new LwgPhrase("Text in layer 1");
      LwgPhrase p2 = new LwgPhrase("Text in layer 2 or layer 3");
      LwgPhrase p3 = new LwgPhrase("Text in layer 3");
      cb.beginLayer(l1);
      ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p1, 50, 600, 0);
      cb.endLayer();
      cb.beginLayer(m1);
      ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p2, 50, 550, 0);
      cb.endLayer();
      cb.beginLayer(l3);
      ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p3, 50, 500, 0);
      cb.endLayer();
      PdfOCProperties p = writer.getOCProperties();
      PdfArray order = new PdfArray();
      order.add(l1.getRef());
      PdfArray group = new PdfArray();
      group.add(new PdfString("A group of two", PdfObject.TEXT_UNICODE));
      group.add(l2.getRef());
      group.add(l3.getRef());
      order.add(group);
      PdfDictionary d = new PdfDictionary();
      d.put(PdfName.ORDER, order);
      p.put(PdfName.D, d);
    } catch (DocumentException de) {
View Full Code Here

            document.open();
            // step 4
            PdfContentByte cb = writer.getDirectContent();
            LwgPhrase explanation = new LwgPhrase("Automatic layer grouping and nesting", new LwgFont(LwgFont.HELVETICA, 20, LwgFont.BOLD, Color.red));
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, explanation, 50, 650, 0);
            PdfLayer l12 = new PdfLayer("Layer nesting", writer);
            PdfLayer l1 = new PdfLayer("Layer 1", writer);
            PdfLayer l2 = new PdfLayer("Layer 2", writer);
            PdfLayer title = PdfLayer.createTitle("Layer grouping", writer);
            PdfLayer l3 = new PdfLayer("Layer 3", writer);
            PdfLayer l4 = new PdfLayer("Layer 4", writer);
            l12.addChild(l1);
            l12.addChild(l2);
            title.addChild(l3);
            title.addChild(l4);
            LwgPhrase p1 = new LwgPhrase("Text in layer 1");
View Full Code Here

      PdfContentByte cb = writer.getDirectContent();
      LwgPhrase explanation = new LwgPhrase("Ordered layers", new LwgFont(
          LwgFont.HELVETICA, 20, LwgFont.BOLD, Color.red));
      ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, explanation, 50,
          650, 0);
      PdfLayer l1 = new PdfLayer("Layer 1", writer);
      PdfLayer l2 = new PdfLayer("Layer 2", writer);
      PdfLayer l3 = new PdfLayer("Layer 3", writer);
      PdfLayerMembership m1 = new PdfLayerMembership(writer);
      m1.addMember(l2);
      m1.addMember(l3);
      LwgPhrase p1 = new LwgPhrase("Text in layer 1");
      LwgPhrase p2 = new LwgPhrase("Text in layer 2 or layer 3");
      LwgPhrase p3 = new LwgPhrase("Text in layer 3");
      cb.beginLayer(l1);
      ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p1, 50, 600, 0);
      cb.endLayer();
      cb.beginLayer(m1);
      ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p2, 50, 550, 0);
      cb.endLayer();
      cb.beginLayer(l3);
      ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p3, 50, 500, 0);
      cb.endLayer();
      cb.sanityCheck();
     
      PdfOCProperties p = writer.getOCProperties();
      PdfArray order = new PdfArray();
      order.add(l1.getRef());
      order.add(l2.getRef());
      order.add(l3.getRef());
      PdfDictionary d = new PdfDictionary();
      d.put(PdfName.ORDER, order);
      p.put(PdfName.D, d);
      // step 5
      document.close();
View Full Code Here

            document.open();
            // step 4
            PdfContentByte cb = writer.getDirectContent();
            Phrase explanation = new Phrase("Automatic layer grouping and nesting", new Font(Font.HELVETICA, 20, Font.BOLD, Color.red));
            ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, explanation, 50, 650, 0);
            PdfLayer l12 = new PdfLayer("Layer nesting", writer);
            PdfLayer l1 = new PdfLayer("Layer 1", writer);
            PdfLayer l2 = new PdfLayer("Layer 2", writer);
            PdfLayer title = PdfLayer.createTitle("Layer grouping", writer);
            PdfLayer l3 = new PdfLayer("Layer 3", writer);
            PdfLayer l4 = new PdfLayer("Layer 4", writer);
            l12.addChild(l1);
            l12.addChild(l2);
            title.addChild(l3);
            title.addChild(l4);
            Phrase p1 = new Phrase("Text in layer 1");
View Full Code Here

      PdfContentByte cb = writer.getDirectContent();
      Phrase explanation = new Phrase("Ordered layers", new Font(
          Font.HELVETICA, 20, Font.BOLD, Color.red));
      ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, explanation, 50,
          650, 0);
      PdfLayer l1 = new PdfLayer("Layer 1", writer);
      PdfLayer l2 = new PdfLayer("Layer 2", writer);
      PdfLayer l3 = new PdfLayer("Layer 3", writer);
      PdfLayerMembership m1 = new PdfLayerMembership(writer);
      m1.addMember(l2);
      m1.addMember(l3);
      Phrase p1 = new Phrase("Text in layer 1");
      Phrase p2 = new Phrase("Text in layer 2 or layer 3");
      Phrase p3 = new Phrase("Text in layer 3");
      cb.beginLayer(l1);
      ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, p1, 50, 600, 0);
      cb.endLayer();
      cb.beginLayer(m1);
      ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, p2, 50, 550, 0);
      cb.endLayer();
      cb.beginLayer(l3);
      ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, p3, 50, 500, 0);
      cb.endLayer();
      cb.sanityCheck();
     
      PdfOCProperties p = writer.getOCProperties();
      PdfArray order = new PdfArray();
      order.add(l1.getRef());
      order.add(l2.getRef());
      order.add(l3.getRef());
      PdfDictionary d = new PdfDictionary();
      d.put(PdfName.ORDER, order);
      p.put(PdfName.D, d);
      // step 5
      document.close();
View Full Code Here

            document.open();
            // step 4: content
            PdfContentByte cb = writer.getDirectContent();
            Phrase explanation = new Phrase("Automatic layers, form fields, images, templates and actions", new Font(Font.HELVETICA, 18, Font.BOLD, Color.red));
            ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, explanation, 50, 650, 0);
            PdfLayer l1 = new PdfLayer("Layer 1", writer);
            PdfLayer l2 = new PdfLayer("Layer 2", writer);
            PdfLayer l3 = new PdfLayer("Layer 3", writer);
            PdfLayer l4 = new PdfLayer("Form and XObject Layer", writer);
            PdfLayerMembership m1 = new PdfLayerMembership(writer);
            m1.addMember(l2);
            m1.addMember(l3);
            Phrase p1 = new Phrase("Text in layer 1");
            Phrase p2 = new Phrase("Text in layer 2 or layer 3");
View Full Code Here

TOP

Related Classes of com.lowagie.text.pdf.PdfLayer

Copyright © 2018 www.massapicom. 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.