Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfContentByte


         float fltHeight)
   {
         int width = (int)(fltWidth);
         int height = (int)(fltHeight);
         // step 4
         PdfContentByte cb = writer.getDirectContent();

         PdfTemplate tp = cb.createTemplate(width, height);

         Graphics2D g2d = tp.createGraphics(width, height, new DefaultFontMapper());

         Rectangle2D r2d = new Rectangle2D.Double(0, 0, width, height);

         chart.draw(g2d, r2d);
         g2d.dispose();

         tp.sanityCheck();
         cb.addTemplate(tp, fltX, fltY);
         cb.sanityCheck();
     
   }
View Full Code Here


            writer.setPdfVersion(PdfWriter.VERSION_1_5);
            writer.setViewerPreferences(PdfWriter.PageModeUseOC);
            // step 3
            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);
            radio.add(l3);
            writer.addOCGRadioGroup(radio);
            LwgPhrase p1 = new LwgPhrase("Text in layer 1");
            LwgPhrase p2 = new LwgPhrase("Text in layer 2");
            LwgPhrase p3 = new LwgPhrase("Text in layer 3");
            LwgPhrase p4 = new LwgPhrase("Text in layer 4");
            cb.beginLayer(l1);
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p1, 50, 600, 0);
            cb.endLayer();
            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.beginLayer(l4);
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, p4, 50, 450, 0);
            cb.endLayer();
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, new LwgPhrase("<< Zoom here!", new LwgFont(LwgFont.COURIER, 12, LwgFont.NORMAL, Color.blue)), 150, 450, 0);
            // step 5
            document.close();
        }
        catch(Exception de) {
View Full Code Here

    /**
     * @see com.lowagie.text.pdf.PdfPageEventHelper#onStartPage(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document)
     */
    public void onStartPage(PdfWriter writer, LwgDocument document) {
        if (writer.getPageNumber() < 3) {
            PdfContentByte cb = writer.getDirectContentUnder();
            cb.saveState();
            cb.setColorFill(Color.pink);
            cb.beginText();
            cb.setFontAndSize(helv, 48);
            cb.showTextAligned(LwgElement.ALIGN_CENTER, "My Watermark Under " + writer.getPageNumber(), document.getPageSize().getWidth() / 2, document.getPageSize().getHeight() / 2, 45);
            cb.endText();
            cb.restoreState();
        }
    }
View Full Code Here

            // step 2: creation of a writer
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("groups.pdf"));
            // step 3: we open the document
            document.open();
            // step 4: content
            PdfContentByte cb = writer.getDirectContent();
            float gap = (document.getPageSize().getWidth() - 400) / 3;
           
            pictureBackdrop(gap, 500, cb);
            pictureBackdrop(200 + 2 * gap, 500, cb);
            pictureBackdrop(gap, 500 - 200 - gap, cb);
            pictureBackdrop(200 + 2 * gap, 500 - 200 - gap, cb);

            PdfTemplate tp;
            PdfTransparencyGroup group;
           
            tp = cb.createTemplate(200, 200);
            pictureCircles(0, 0, tp);
            group = new PdfTransparencyGroup();
            group.setIsolated(true);
            group.setKnockout(true);
            tp.setGroup(group);
            tp.sanityCheck();
            cb.addTemplate(tp, gap, 500);

           
            tp = cb.createTemplate(200, 200);
            pictureCircles(0, 0, tp);
            group = new PdfTransparencyGroup();
            group.setIsolated(true);
            group.setKnockout(false);
            tp.setGroup(group);
            tp.sanityCheck();
            cb.addTemplate(tp, 200 + 2 * gap, 500);

           
            tp = cb.createTemplate(200, 200);
            pictureCircles(0, 0, tp);
            group = new PdfTransparencyGroup();
            group.setIsolated(false);
            group.setKnockout(true);
            tp.setGroup(group);
            tp.sanityCheck();
            cb.addTemplate(tp, gap, 500 - 200 - gap);

           
            tp = cb.createTemplate(200, 200);
            pictureCircles(0, 0, tp);
            group = new PdfTransparencyGroup();
            group.setIsolated(false);
            group.setKnockout(false);
            tp.setGroup(group);
            tp.sanityCheck();
            cb.addTemplate(tp, 200 + 2 * gap, 500 - 200 - gap);

            cb.sanityCheck();
        }
        catch (Exception de) {
            de.printStackTrace();
        }
        // step 5: we close the document
View Full Code Here

           
            // step 3: we open the document
            document.open();
           
            // step 4: we grab the ContentByte and do some stuff with it
            PdfContentByte cb = writer.getDirectContent();
           
            BaseFont bf = BaseFont.createFont("Times-Roman", "winansi", false);
           
            // step 5: we create some PdfPatternPainter instances for drawing path, text, or placing image
           
            // LwgImage instance to be placed in PdfPatternPainter canvas. Any nice one?
            LwgImage img = LwgImage.getInstance("pngnow.png");

            PdfPatternPainter p = cb.createPattern(60f, 60f, 60f, 60f);
            PdfPatternPainter p1 = cb.createPattern(60f, 60f, 60f, 60f);
            PdfPatternPainter p2 = cb.createPattern(img.getScaledWidth(), img.getScaledHeight(), img.getScaledWidth(), img.getScaledHeight());
           
           
            // step 6: put your drawing instruction in the painter canvas
           
            // A star pattern taken from Adobe PDF Reference Book p.207
            String star = "0.3 g\n15.000 27.000 m\n"
            + "7.947 5.292 l\n26.413 18.708 l\n"
            + "3.587 18.708 l\n22.053 5.292 l\nf\n"
            + "45.000 57.000 m\n37.947 35.292 l\n"
            + "56.413 48.708 l\n33.587 48.708 l\n"
            + "52.053 35.292 l\nf\n"
            + "0.7 g\n15.000 57.000 m\n"
            + "7.947 35.292 l\n26.413 48.708 l\n"
            + "3.587 48.708 l\n22.053 35.292 l\nf\n"
            + "45.000 27.000 m\n37.947 5.292 l\n"
            + "56.413 18.708 l\n33.587 18.708 l\n"
            + "52.053 5.292 l\nf";
           
            p.setLiteral(star);
           
            // A Pattern with some text drawing
            p1.setGrayFill(0.3f);
            p1.setFontAndSize(bf, 12);
            p1.beginText();
            p1.setTextMatrix(1f, 0f, 0f, 1f, 0f, 0f);
            p1.showText("A B C D");
            p1.endText();
            p1.moveTo(0f, 0f);
            p1.lineTo(60f, 60f);
            p1.stroke();
            p1.sanityCheck();
           
            // A pattern with an image and position
            p2.addImage(img, img.getScaledWidth(), 0f, 0f, img.getScaledHeight(), 0f, 0f);
            p2.setPatternMatrix(1f, 0f, 0f, 1f, 60f, 60f);
            p2.sanityCheck();
           
            // See if we can apply the pattern color to chunk, phrase or paragraph
            PatternColor pat = new PatternColor(p);
            PatternColor pat1 = new PatternColor(p1);
            PatternColor pat2 = new PatternColor(p2);
            String text = "Text with pattern";
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, new GrayColor(0.3f))));
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, pat)));
           
            // draw a rectangle filled with star pattern
            cb.setPatternFill(p);
            cb.setGrayStroke(0.0f);
            cb.rectangle(20, 20, 284, 120);
            cb.fillStroke();
           
            // draw some characters filled with star.
            // Note: A gray, rgb, cmyk or spot color should be applied first
            // otherwise, you will not be able to see the character glyph
            // since the glyph path is filled by pattern
            cb.beginText();
            cb.setFontAndSize(bf, 1);
            cb.setTextMatrix(270f, 0f, 0f, 270f, 20f, 100f);
            cb.setGrayFill(0.9f);
            cb.showText("ABC");
            cb.setPatternFill(p);
            cb.moveTextWithLeading(0.0f, 0.0f);
            cb.showText("ABC");
            cb.endText();
            cb.setPatternFill(p);
           
            // draw a circle. Similar to rectangle
            cb.setGrayStroke(0.0f);
            cb.circle(150f, 400f, 150f);
            cb.fillStroke();
           
            // New Page to draw text in the pattern painter's canvas
            document.newPage();
           
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, new GrayColor(0.3f))));
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, pat1)));
            // draw a rectangle
            cb.setPatternFill(p1);
            cb.setGrayStroke(0.0f);
            cb.rectangle(0, 0, 284, 120);
            cb.fillStroke();
           
            // draw some characters
            cb.beginText();
            cb.setFontAndSize(bf, 1);
            cb.setTextMatrix(270f, 0f, 0f, 270f, 20f, 100f);
            cb.setGrayFill(0.9f);
            cb.showText("ABC");
            cb.setPatternFill(p1);
            cb.moveTextWithLeading(0.0f, 0.0f);
            cb.showText("ABC");
            cb.endText();
           
            // draw a circle
            cb.setPatternFill(p1);
            cb.setGrayStroke(0.0f);
            cb.circle(150f, 400f, 150f);
            cb.fillStroke();
            cb.sanityCheck();
           
            // New page to place image in the pattern painter's canvas
            document.newPage();
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, new GrayColor(0.3f))));
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, pat2)));
            // The original LwgImage for comparison reason.
            // Note: The width and height is the same as bbox in pattern
            cb.addImage(img, img.getScaledWidth(), 0f, 0f, img.getScaledHeight(), 350f, 400f);
           
            // draw a rectangle
            cb.setPatternFill(p2);
            cb.setGrayStroke(0.0f);
            cb.rectangle(60, 60, 300, 120);
            cb.fillStroke();
           
            // draw some characters.
            // Note: if the image fills up the pattern, there's no need to draw text twice
            // since colors in image will be clipped to character glyph path
            cb.beginText();
            cb.setFontAndSize(bf, 1);
            cb.setTextMatrix(270f, 0f, 0f, 270f, 60f, 120f);
            cb.setPatternFill(p2);
            cb.showText("ABC");
            cb.endText();
           
            // draw a circle
            cb.setPatternFill(p2);
            cb.setGrayStroke(0.0f);
            cb.circle(150f, 400f, 150f);
            cb.fillStroke();
           
            cb.sanityCheck();
        }
        catch(Exception e) {
            e.printStackTrace();
        }
       
View Full Code Here

            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("shading_pattern.pdf"));
            document.open();

            PdfShading shading = PdfShading.simpleAxial(writer, 100, 100, 400, 100, Color.red, Color.cyan);
            PdfShadingPattern shadingPattern = new PdfShadingPattern(shading);
            PdfContentByte cb = writer.getDirectContent();
            BaseFont bf = BaseFont.createFont(BaseFont.TIMES_BOLD, BaseFont.WINANSI, false);
            cb.setShadingFill(shadingPattern);
            cb.beginText();
            cb.setTextMatrix(100, 100);
            cb.setFontAndSize(bf, 40);
            cb.showText("Look at this text!");
            cb.endText();
            PdfShading shadingR = PdfShading.simpleRadial(writer, 200, 500, 50, 300, 500, 100, new Color(255, 247, 148), new Color(247, 138, 107), false, false);
            cb.paintShading(shadingR);
            cb.sanityCheck();
            document.close();
        }
        catch (Exception de) {
            de.printStackTrace();
        }
View Full Code Here

                new float[]{.929f, .357f, 1, .298f}, new float[]{.941f, .4f, 1, .102f}, 1.374f);
            PdfFunction function3 = PdfFunction.type3(writer, new float[]{0, 1}, null,
                new PdfFunction[]{function1, function2}, new float[]{.708f}, new float[]{1, 0, 0, 1});
            PdfShading shading = PdfShading.type3(writer, new CMYKColor(0, 0, 0, 0),
                new float[]{0, 0, .096f, 0, 0, 1}, null, function3, new boolean[]{true, true});
            PdfContentByte cb = writer.getDirectContent();
            cb.moveTo(316.789f, 140.311f);
            cb.curveTo(303.222f, 146.388f, 282.966f, 136.518f, 279.122f, 121.983f);
            cb.lineTo(277.322f, 120.182f);
            cb.curveTo(285.125f, 122.688f, 291.441f, 121.716f, 298.156f, 119.386f);
            cb.lineTo(336.448f, 119.386f);
            cb.curveTo(331.072f, 128.643f, 323.346f, 137.376f, 316.789f, 140.311f);
            cb.clip();
            cb.newPath();
            cb.saveState();
            cb.concatCTM(27.7843f, 0, 0, -27.7843f, 310.2461f, 121.1521f);
            cb.paintShading(shading);
            cb.restoreState();
           
            cb.sanityCheck();
           
            document.close();
        }
        catch (Exception de) {
            de.printStackTrace();
View Full Code Here

            // step 2: creation of a writer
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("transparency.pdf"));
            // step 3: we open the document
            document.open();
            // step 4: content
            PdfContentByte cb = writer.getDirectContent();
            float gap = (document.getPageSize().getWidth() - 400) / 3;
           
            pictureBackdrop(gap, 500, cb);
            pictureBackdrop(200 + 2 * gap, 500, cb);
            pictureBackdrop(gap, 500 - 200 - gap, cb);
            pictureBackdrop(200 + 2 * gap, 500 - 200 - gap, cb);
           
            pictureCircles(gap, 500, cb);
            cb.saveState();
            PdfGState gs1 = new PdfGState();
            gs1.setFillOpacity(0.5f);
            cb.setGState(gs1);
            pictureCircles(200 + 2 * gap, 500, cb);
            cb.restoreState();

            PdfTemplate tp = cb.createTemplate(200, 200);
            cb.saveState();
            pictureCircles(0, 0, tp);
            PdfTransparencyGroup group = new PdfTransparencyGroup();
            tp.setGroup(group);
            tp.sanityCheck();
            cb.setGState(gs1);
            cb.addTemplate(tp, gap, 500 - 200 - gap);
            cb.restoreState();

            tp = cb.createTemplate(200, 200);
            cb.saveState();
            PdfGState gs2 = new PdfGState();
            gs2.setFillOpacity(0.5f);
            gs2.setBlendMode(PdfGState.BM_SOFTLIGHT);
            tp.setGState(gs2);
            tp.sanityCheck();
            pictureCircles(0, 0, tp);
            tp.setGroup(group);
            cb.addTemplate(tp, 200 + 2 * gap, 500 - 200 - gap);
            cb.restoreState();

            cb.resetRGBColorFill();
            ColumnText ct = new ColumnText(cb);
            LwgPhrase ph = new LwgPhrase("Ungrouped objects\nObject opacity = 1.0");
            ct.setSimpleColumn(ph, gap, 0, gap + 200, 500, 18, LwgElement.ALIGN_CENTER);
            ct.go();
           
            ph = new LwgPhrase("Ungrouped objects\nObject opacity = 0.5");
            ct.setSimpleColumn(ph, 200 + 2 * gap, 0, 200 + 2 * gap + 200, 500, 18, LwgElement.ALIGN_CENTER);
            ct.go();
           
            ph = new LwgPhrase("Transparency group\nObject opacity = 1.0\nGroup opacity = 0.5\nBlend mode = Normal");
            ct.setSimpleColumn(ph, gap, 0, gap + 200, 500 - 200 - gap, 18, LwgElement.ALIGN_CENTER);
            ct.go();
           
            ph = new LwgPhrase("Transparency group\nObject opacity = 0.5\nGroup opacity = 1.0\nBlend mode = SoftLight");
            ct.setSimpleColumn(ph, 200 + 2 * gap, 0, 200 + 2 * gap + 200, 500 - 200 - gap, 18, LwgElement.ALIGN_CENTER);
            ct.go();
           
            cb.sanityCheck();
        }
        catch (Exception de) {
            de.printStackTrace();
        }
        // step 5: we close the document
View Full Code Here

                characters.add(code[i] + "\n");
                names.add(name[i] + "\n");
            }
           
            // we grab the ContentByte and do some stuff with it
            PdfContentByte cb = writer.getDirectContent();
           
            ColumnText ct = new ColumnText(cb);
            ct.setSimpleColumn(unicodes, 60, 300, 100, 300 + 28 * 15, 15, LwgElement.ALIGN_CENTER);
            ct.go();
            cb.rectangle(103, 295, 52, 8 + 28 * 15);
            cb.stroke();
            ct.setSimpleColumn(characters, 105, 300, 150, 300 + 28 * 15, 15, LwgElement.ALIGN_RIGHT);
            ct.go();
            ct.setSimpleColumn(names, 160, 300, 500, 300 + 28 * 15, 15, LwgElement.ALIGN_LEFT);
            ct.go();
           
View Full Code Here

            // step 3: we open the document
            document.open();
           
            // step 4:
            // we grab the contentbyte and do some stuff with it
            PdfContentByte cb = writer.getDirectContent();
           
            PdfTemplate t = cb.createTemplate(600, 800);
            LwgImage caesar = LwgImage.getInstance("caesar_coin.jpg");
            cb.addImage(caesar, 100, 0, 0, 100, 260, 595);
            t.setGrayFill(0.75f);
            t.moveTo(310, 112);
            t.lineTo(280, 60);
            t.lineTo(340, 60);
            t.closePath();
            t.moveTo(310, 790);
            t.lineTo(310, 710);
            t.moveTo(310, 580);
            t.lineTo(310, 122);
            t.stroke();
            cb.addTemplate(t, 0, 0);
           
            ColumnText ct = new ColumnText(cb);
            ct.addText(new LwgPhrase("GALLIA est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur.  Hi omnes lingua, institutis, legibus inter se differunt. Gallos ab Aquitanis Garumna flumen, a Belgis Matrona et Sequana dividit. Horum omnium fortissimi sunt Belgae, propterea quod a cultu atque humanitate provinciae longissime absunt, minimeque ad eos mercatores saepe commeant atque ea quae ad effeminandos animos pertinent important, proximique sunt Germanis, qui trans Rhenum incolunt, quibuscum continenter bellum gerunt.  Qua de causa Helvetii quoque reliquos Gallos virtute praecedunt, quod fere cotidianis proeliis cum Germanis contendunt, cum aut suis finibus eos prohibent aut ipsi in eorum finibus bellum gerunt.\n", FontFactory.getFont(FontFactory.HELVETICA, 12)));
            ct.addText(new LwgPhrase("[Eorum una, pars, quam Gallos obtinere dictum est, initium capit a flumine Rhodano, continetur Garumna flumine, Oceano, finibus Belgarum, attingit etiam ab Sequanis et Helvetiis flumen Rhenum, vergit ad septentriones. Belgae ab extremis Galliae finibus oriuntur, pertinent ad inferiorem partem fluminis Rheni, spectant in septentrionem et orientem solem. Aquitania a Garumna flumine ad Pyrenaeos montes et eam partem Oceani quae est ad Hispaniam pertinet; spectat inter occasum solis et septentriones.]\n", FontFactory.getFont(FontFactory.HELVETICA, 12)));
            ct.addText(new LwgPhrase("Apud Helvetios longe nobilissimus fuit et ditissimus Orgetorix.  Is M. Messala, [et P.] M.  Pisone consulibus regni cupiditate inductus coniurationem nobilitatis fecit et civitati persuasit ut de finibus suis cum omnibus copiis exirent:  perfacile esse, cum virtute omnibus praestarent, totius Galliae imperio potiri.  Id hoc facilius iis persuasit, quod undique loci natura Helvetii continentur:  una ex parte flumine Rheno latissimo atque altissimo, qui agrum Helvetium a Germanis dividit; altera ex parte monte Iura altissimo, qui est inter Sequanos et Helvetios; tertia lacu Lemanno et flumine Rhodano, qui provinciam nostram ab Helvetiis dividit.  His rebus fiebat ut et minus late vagarentur et minus facile finitimis bellum inferre possent; qua ex parte homines bellandi cupidi magno dolore adficiebantur.  Pro multitudine autem hominum et pro gloria belli atque fortitudinis angustos se fines habere arbitrabantur, qui in longitudinem milia passuum CCXL, in latitudinem CLXXX patebant.\n", FontFactory.getFont(FontFactory.HELVETICA, 12)));
            ct.addText(new LwgPhrase("His rebus adducti et auctoritate Orgetorigis permoti constituerunt ea quae ad proficiscendum pertinerent comparare, iumentorum et carrorum quam maximum numerum coemere, sementes quam maximas facere, ut in itinere copia frumenti suppeteret, cum proximis civitatibus pacem et amicitiam confirmare.  Ad eas res conficiendas biennium sibi satis esse duxerunt; in tertium annum profectionem lege confirmant.  Ad eas res conficiendas Orgetorix deligitur.  Is sibi legationem ad civitates suscipit.  In eo itinere persuadet Castico, Catamantaloedis filio, Sequano, cuius pater regnum in Sequanis multos annos obtinuerat et a senatu populi Romani amicus appellatus erat, ut regnum in civitate sua occuparet, quod pater ante habuerit; itemque Dumnorigi Haeduo, fratri Diviciaci, qui eo tempore principatum in civitate obtinebat ac maxime plebi acceptus erat, ut idem conaretur persuadet eique filiam suam in matrimonium dat.  Perfacile factu esse illis probat conata perficere, propterea quod ipse suae civitatis imperium obtenturus esset:  non esse dubium quin totius Galliae plurimum Helvetii possent; se suis copiis suoque exercitu illis regna conciliaturum confirmat.  Hac oratione adducti inter se fidem et ius iurandum dant et regno occupato per tres potentissimos ac firmissimos populos totius Galliae sese potiri posse sperant.\n", FontFactory.getFont(FontFactory.HELVETICA, 12)));
            ct.addText(new LwgPhrase("Ea res est Helvetiis per indicium enuntiata.  Moribus suis Orgetoricem ex vinculis causam dicere coegerunt; damnatum poenam sequi oportebat, ut igni cremaretur.  Die constituta causae dictionis Orgetorix ad iudicium omnem suam familiam, ad hominum milia decem, undique coegit, et omnes clientes obaeratosque suos, quorum magnum numerum habebat, eodem conduxit; per eos ne causam diceret se eripuit.  Cum civitas ob eam rem incitata armis ius suum exequi conaretur multitudinemque hominum ex agris magistratus cogerent, Orgetorix mortuus est; neque abest suspicio, ut Helvetii arbitrantur, quin ipse sibi mortem consciverit.", FontFactory.getFont(FontFactory.HELVETICA, 12)));
           
            float[] left1  = {70,790, 70,60};
            float[] right1 = {300,790, 300,700, 240,700, 240,590, 300,590, 300,106, 270,60};
            float[] left2  = {320,790, 320,700, 380,700, 380,590, 320,590, 320,106, 350,60};
            float[] right2 = {550,790, 550,60};
           
            int status = 0;
            int column = 0;
            while ((status & ColumnText.NO_MORE_TEXT) == 0) {
                if (column == 0) {
                    ct.setColumns(left1, right1);
                    column = 1;
                }
                else {
                    ct.setColumns(left2, right2);
                    column = 0;
                }
                status = ct.go();
                ct.setYLine(790);
                ct.setAlignment(LwgElement.ALIGN_JUSTIFIED);
                status = ct.go();
                if ((column == 0) && ((status & ColumnText.NO_MORE_COLUMN) != 0)) {
                    document.newPage();
                    cb.addTemplate(t, 0, 0);
                    cb.addImage(caesar, 100, 0, 0, 100, 260, 595);
                }
            }
        }
        catch(DocumentException de) {
            System.err.println(de.getMessage());
View Full Code Here

TOP

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

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.