Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfContentByte.stroke()


            cb.rectangle(100, 700, 100, 100);
            // add the diagonal
            cb.moveTo(100, 700);
            cb.lineTo(200, 800);
            // stroke the lines
            cb.stroke();
           
            // Fill a rectangle with CMYK alternate
            cb.setColorFill(spc_cmyk, 0.25f);
            cb.rectangle(250, 700, 100, 100);
            cb.fill();
View Full Code Here


           
            // Stroke a circle with RGB alternate
            cb.setColorStroke(spc_rgb, 0.9f);
            cb.setLineWidth(5f);
            cb.circle(150f, 500f, 100f);
            cb.stroke();
           
            // Fill the circle with RGB alternate
            cb.setColorFill(spc_rgb, 0.9f);
            cb.circle(150f, 500f, 50f);
            cb.fill();
View Full Code Here

            for (int i = 0; i < 27; i++) {
                ct.addText(new Phrase(15, uni[i] + "\n", font));
            }
            ct.go();
            cb.rectangle(103, 295, 52, 8 + 28 * 15);
            cb.stroke();
            ct.setSimpleColumn(105, 300, 150, 300 + 28 * 15, 15, Element.ALIGN_RIGHT);
            ct.addText(new Phrase(15, "char\n", font));
            for (int i = 0; i < 27; i++) {
                ct.addText(new Phrase(15, code[i] + "\n", font));
            }
View Full Code Here

            // draw rectangles to show where the annotations were added
            cb1.rectangle(250, 700, 100, 100);
            cb1.rectangle(250, 550, 100, 100);
            cb1.rectangle(250, 400, 100, 100);
            cb1.rectangle(250, 250, 100, 100);
            cb1.stroke();
            // more content
            document1.newPage();
            for (int i = 0; i < 5; i++) {
              document1.add(new Paragraph("blahblahblah"));
            }
View Full Code Here

            // draw rectangles to show where the annotations were added
            cb2.rectangle(100, 700, 100, 100);
            cb2.rectangle(100, 550, 100, 100);
            cb2.rectangle(100, 400, 100, 100);
            cb2.rectangle(100, 250, 100, 100);
            cb2.stroke();
    } catch (Exception de) {
      de.printStackTrace();
    }

    // step 5: we close the document
View Full Code Here

      writer.addAnnotation(PdfAnnotation.createText(writer, new Rectangle(200f, 250f, 300f, 350f), "Help", "This Comment annotation was made with 'createText'", true, "Comment"));
      cb.rectangle(200, 700, 100, 100);
      cb.rectangle(200, 550, 100, 100);
      cb.rectangle(200, 400, 100, 100);
      cb.rectangle(200, 250, 100, 100);
      cb.stroke();
      document.newPage();
      // page 2
      writer.addAnnotation(PdfAnnotation.createLink(writer, new Rectangle(200f, 700f, 300f, 800f), PdfAnnotation.HIGHLIGHT_TOGGLE, PdfAction.javaScript("app.alert('Hello');\r", writer)));
      writer.addAnnotation(PdfAnnotation.createLink(writer, new Rectangle(200f, 550f, 300f, 650f), PdfAnnotation.HIGHLIGHT_OUTLINE, "top"));
      writer.addAnnotation(PdfAnnotation.createLink(writer, new Rectangle(200f, 400f, 300f, 500f), PdfAnnotation.HIGHLIGHT_PUSH, 1, new PdfDestination(PdfDestination.FIT)));
View Full Code Here

        cb.saveState();
      // border for the complete table
        cb.setLineWidth(2);
        cb.setRGBColorStroke(255, 0, 0);
        cb.rectangle(widths[0], heights[heights.length - 1], widths[widths.length - 1] - widths[0], heights[0] - heights[heights.length - 1]);
        cb.stroke();
       
        // border for the header rows
        if (headerRows > 0) {
            float headerHeight = heights[0];
            for (int k = 0; k < headerRows; ++k)
View Full Code Here

            float headerHeight = heights[0];
            for (int k = 0; k < headerRows; ++k)
                headerHeight += heights[k];
            cb.setRGBColorStroke(0, 0, 255);
            cb.rectangle(widths[0], heights[headerRows], widths[widths.length - 1] - widths[0], heights[0] - heights[headerRows]);
            cb.stroke();
        }
        cb.restoreState();
       
        cb = canvases[PdfPTable.BASECANVAS];
        cb.saveState();
View Full Code Here

                        widths[col], heights[line + 1], widths[col + 1], heights[line]);
                cb.setRGBColorStrokeF((float)Math.random(), (float)Math.random(), (float)Math.random());
                // horizontal borderline
                cb.moveTo(widths[col], heights[line]);
                cb.lineTo(widths[col + 1], heights[line]);
                cb.stroke();
                // vertical borderline
                cb.setRGBColorStrokeF((float)Math.random(), (float)Math.random(), (float)Math.random());
                cb.moveTo(widths[col], heights[line]);
                cb.lineTo(widths[col], heights[line + 1]);
                cb.stroke();
View Full Code Here

                cb.stroke();
                // vertical borderline
                cb.setRGBColorStrokeF((float)Math.random(), (float)Math.random(), (float)Math.random());
                cb.moveTo(widths[col], heights[line]);
                cb.lineTo(widths[col], heights[line + 1]);
                cb.stroke();
            }
        }
        cb.restoreState();
    }
   
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.