public static void prost(PdfContentByte cb, int x, int y, int x1, int y1) {
   cb.saveState();
   PdfSpotColor color = new PdfSpotColor(RESULT, BaseColor.BLACK);
   cb.setLineWidth((float) 0.5);
   cb.setColorStroke(color, (float) 0.5);
   cb.setFlatness(y1);
   cb.rectangle(x, y, x1, y1);
   cb.stroke();
   cb.restoreState();
 }
Beispiel #2
0
  public static void renderShapes(PdfContentByte contentByte) {
    contentByte.setColorStroke(BaseColor.BLACK);
    contentByte.setColorFill(BaseColor.GRAY);

    for (int row = 0; row < 4; row++) {
      for (int column = 0; column < 4; column++) {
        contentByte.rectangle(column * 10 + 50, row * 10 + 50, 10, 10);
        contentByte.fillStroke();
      }
    }
  }
Beispiel #3
0
 public static void renderText(
     PdfContentByte contentByte, float x, float y, String text, int fontSize)
     throws DocumentException, IOException {
   BaseFont font =
       BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED);
   contentByte.setColorStroke(BaseColor.BLACK);
   contentByte.setColorFill(BaseColor.BLACK);
   contentByte.beginText();
   contentByte.setFontAndSize(font, fontSize);
   contentByte.setTextMatrix(x, y);
   contentByte.showText(text);
   contentByte.endText();
 }