Package com.lowagie.text.pdf

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


            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[LwgPdfPTable.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

    float y1 = height[0];
    float y2 = height[height.length - 1];
    PdfContentByte canvas = canvases[LwgPdfPTable.LINECANVAS];
    canvas.setRGBColorStroke(0x00, 0x00, 0xFF);
    canvas.rectangle(x1, y1, x2 - x1, y2 - y1);
    canvas.stroke();
    canvas.resetRGBColorStroke();
  }

  /**
   * @see com.lowagie.text.pdf.PdfPCellEvent#cellLayout(com.lowagie.text.pdf.PdfPCell,
View Full Code Here

    float y1 = position.getTop() - 2;
    float y2 = position.getBottom() + 2;
    PdfContentByte canvas = canvases[LwgPdfPTable.LINECANVAS];
    canvas.setRGBColorStroke(0xFF, 0x00, 0x00);
    canvas.rectangle(x1, y1, x2 - x1, y2 - y1);
    canvas.stroke();
    canvas.resetRGBColorStroke();
  }

  /**
   * Example originally written by Wendy Smoak to generate a Table with
View Full Code Here

  public void cellLayout(LwgPdfPCell cell, LwgRectangle position,
      PdfContentByte[] canvases) {
    PdfContentByte cb = canvases[LwgPdfPTable.TEXTCANVAS];
    cb.moveTo(position.getLeft(), position.getBottom());
    cb.lineTo(position.getRight(), position.getTop());
    cb.stroke();
  }

  /**
   * General example using cell events.
   *
 
View Full Code Here

         cb.lineTo(400, 700);
         cb.moveTo(50, 650);
         cb.lineTo(400, 650);
         cb.moveTo(50, 600);
         cb.lineTo(400, 600);
         cb.stroke();

         // we construct a font
         //BaseFont bf = BaseFont.createFont("c:\\windows\\fonts\\arialuni.ttf", BaseFont.IDENTITY_H, true);
         BaseFont bf = BaseFont.createFont("c:\\windows\\fonts\\comic.ttf", BaseFont.IDENTITY_H, true);
         LwgFont ft = new LwgFont(bf, 12);
View Full Code Here

         ColumnText.showTextAligned(cb, PdfContentByte.ALIGN_RIGHT, new LwgPhrase(text + " Right", ft), 250, 650, 20, PdfWriter.RUN_DIRECTION_RTL, 0);
         ColumnText.showTextAligned(cb, PdfContentByte.ALIGN_LEFT, new LwgPhrase("Some text Left aligned", ft), 250, 600, 20);
         float size = ColumnText.getWidth(center, PdfWriter.RUN_DIRECTION_RTL, 0);
         cb.setRGBColorStroke(255, 0, 0);
         cb.rectangle(250 - size / 2, 690, size, 30);
         cb.stroke();
      }
      catch (DocumentException de)
      {
         System.err.println(de.getMessage());
      }
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[LwgPdfPTable.BASECANVAS];
        cb.saveState();
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.