Package com.lowagie.text

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


            // calculate diamond shaped hole
            float diamondHeight = 400;
            float diamondWidth = 400;
            float gutter = 10;
            float bodyHeight = document.top() - document.bottom();
            float colMaxWidth = (document.right() - document.left() - (gutter * 2)) / 2f;
            float diamondTop = document.top() - ((bodyHeight - diamondHeight) / 2f);
            float diamondInset = colMaxWidth - (diamondWidth / 2f);
            float centerX = (document.right() - document.left()) / 2 + document.left();
            // draw stuff
View Full Code Here


            float diamondInset = colMaxWidth - (diamondWidth / 2f);
            float centerX = (document.right() - document.left()) / 2 + document.left();
            // draw stuff
            PdfContentByte cb = writer.getDirectContentUnder();
           
            MultiColumnText mct = new MultiColumnText(document.top() - document.bottom());

            // setup column 1
            float[] left = {document.left(), document.top(), document.left(), document.bottom()};
            float[] right = {document.left() + colMaxWidth, document.top(),
                             document.left() + colMaxWidth, diamondTop,
View Full Code Here

            PdfContentByte cb = writer.getDirectContentUnder();
           
            MultiColumnText mct = new MultiColumnText(document.top() - document.bottom());

            // setup column 1
            float[] left = {document.left(), document.top(), document.left(), document.bottom()};
            float[] right = {document.left() + colMaxWidth, document.top(),
                             document.left() + colMaxWidth, diamondTop,
                             document.left() + diamondInset, diamondTop - diamondHeight / 2,
                             document.left() + colMaxWidth, diamondTop - diamondHeight,
                             document.left() + colMaxWidth, document.bottom()
View Full Code Here

            float[] left = {document.left(), document.top(), document.left(), document.bottom()};
            float[] right = {document.left() + colMaxWidth, document.top(),
                             document.left() + colMaxWidth, diamondTop,
                             document.left() + diamondInset, diamondTop - diamondHeight / 2,
                             document.left() + colMaxWidth, diamondTop - diamondHeight,
                             document.left() + colMaxWidth, document.bottom()
                            };
            mct.addColumn(left, right);

            // setup column 2
            left = new float[] { document.right() - colMaxWidth, document.top(),
View Full Code Here

            // setup column 2
            left = new float[] { document.right() - colMaxWidth, document.top(),
                                  document.right() - colMaxWidth, diamondTop,
                                  document.right() - diamondInset, diamondTop - diamondHeight / 2,
                                  document.right() - colMaxWidth, diamondTop - diamondHeight,
                                  document.right() - colMaxWidth, document.bottom()
                                 };
            right = new float[] { document.right(), document.top(), document.right(), document.bottom() };
            mct.addColumn(left, right);

            // add text
View Full Code Here

                                  document.right() - colMaxWidth, diamondTop,
                                  document.right() - diamondInset, diamondTop - diamondHeight / 2,
                                  document.right() - colMaxWidth, diamondTop - diamondHeight,
                                  document.right() - colMaxWidth, document.bottom()
                                 };
            right = new float[] { document.right(), document.top(), document.right(), document.bottom() };
            mct.addColumn(left, right);

            // add text
            for (int i=0; i<8; i++) {
                mct.addElement(new Paragraph("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)));
View Full Code Here

            }
           do {
                cb.setLineWidth(5);
                cb.setColorStroke(Color.GRAY);
                cb.moveTo(centerX , document.top());
                cb.lineTo(centerX, document.bottom());
                cb.stroke();
                cb.moveTo(centerX, diamondTop);
                cb.lineTo(centerX - (diamondWidth/2), diamondTop - (diamondHeight / 2));
                cb.lineTo(centerX, diamondTop - diamondHeight);
                cb.lineTo(centerX + (diamondWidth/2), diamondTop - (diamondHeight / 2));
View Full Code Here

            currentY -= 15;
            float topColumn = currentY;
            for (int k = 1; k < numColumns; ++k) {
                float x = allColumns[k] - gutter / 2;
                cb.moveTo(x, topColumn);
                cb.lineTo(x, document.bottom());
            }
            cb.stroke();
            Image img = Image.getInstance("cover.png");
            cb.addImage(img, img.getScaledWidth(), 0, 0, img.getScaledHeight(), document.left(), currentY - img.getScaledHeight());
            currentY -= img.getScaledHeight() + 10;
View Full Code Here

                ct.addText(new Chunk(headings[k] + "\n", font14B));
                ct.addText(new Chunk(texts[k] + "\n\n", font11));
            }

            int currentColumn = 0;
            ct.setSimpleColumn(allColumns[currentColumn], document.bottom(),
                allColumns[currentColumn] + columnWidth, currentY, 15, Element.ALIGN_JUSTIFIED);
            ct.setLeading(2, 1);
            for (;;) {
                int rc = ct.go();
                if ((rc & ColumnText.NO_MORE_TEXT) != 0)
View Full Code Here

                    break;
                // we run out of column. Let's go to another one
                ++currentColumn;
                if (currentColumn >= allColumns.length)
                    break;
                ct.setSimpleColumn(allColumns[currentColumn], document.bottom(),
                    allColumns[currentColumn] + columnWidth, topColumn, 15, Element.ALIGN_JUSTIFIED);
                ct.setLeading(2, 1);
            }
            // step 5: we close the document
            document.close();
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.