Example usage for com.itextpdf.text.pdf PdfContentByte setLineWidth

List of usage examples for com.itextpdf.text.pdf PdfContentByte setLineWidth

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfContentByte setLineWidth.

Prototype


public void setLineWidth(final double w) 

Source Link

Document

Changes the line width.

Usage

From source file:PrefichaPDF.java

public static void drawRectangle(PdfContentByte content, float x, float y, float width, float height) {
    content.saveState();//from   w  w w.j av  a 2s.  c  o m
    PdfGState state = new PdfGState();
    content.setGState(state);
    content.setRGBColorFill(232, 232, 232);
    content.setColorStroke(BaseColor.LIGHT_GRAY);
    //        content.setr
    content.setLineWidth((float) .5);
    content.rectangle(x, y, width, height);
    content.fillStroke();
    content.restoreState();
}

From source file:PrefichaPDF.java

public static void drawRectangleSC(PdfContentByte content, float x, float y, float width, float height) {
    content.saveState();/*from  w  w  w  . j a v a 2  s . c  o m*/
    PdfGState state = new PdfGState();
    //        state.setFillOpacity(0.6f);
    content.setGState(state);
    content.setRGBColorFill(0xFF, 0xFF, 0xFA);
    content.setColorStroke(BaseColor.LIGHT_GRAY);
    content.setLineWidth((float) .5);
    content.rectangle(x, y, width, height);
    content.fillStroke();
    content.restoreState();
}

From source file:PrefichaPDF.java

public static void drawRectangleText(PdfContentByte content, float x, float y, float width, float height) {
    content.saveState();/*from  w ww . ja v a2  s.co m*/
    PdfGState state = new PdfGState();
    content.setGState(state);
    content.setRGBColorFill(0, 230, 255);
    content.setColorStroke(BaseColor.LIGHT_GRAY);
    content.setLineWidth((float) .5);
    content.rectangle(x, y, width, height);
    content.fillStroke();
    content.restoreState();
}

From source file:adams.flow.transformer.pdfproclet.Circle.java

License:Open Source License

/**
 * The actual processing of the document.
 *
 * @param generator   the context/* ww w  .jav  a 2  s .c om*/
 * @param file   the file to add
 * @return      true if successfully added
 * @throws Exception   if something goes wrong
 */
protected boolean doProcess(PDFGenerator generator, File file) throws Exception {
    PdfContentByte cb;

    cb = generator.getWriter().getDirectContent();
    cb.saveState();
    cb.setColorStroke(new BaseColor(m_Color.getRGB()));
    cb.setColorFill(new BaseColor(m_Color.getRGB()));
    cb.setLineWidth(m_LineWidth);
    cb.circle(m_X, m_Y, m_Radius);
    if (m_Fill)
        cb.fillStroke();
    else
        cb.stroke();
    cb.restoreState();

    return true;
}

From source file:adams.flow.transformer.pdfproclet.Line.java

License:Open Source License

/**
 * The actual processing of the document.
 *
 * @param generator   the context// ww  w.j  ava 2  s.c  o m
 * @param file   the file to add
 * @return      true if successfully added
 * @throws Exception   if something goes wrong
 */
protected boolean doProcess(PDFGenerator generator, File file) throws Exception {
    PdfContentByte cb;

    cb = generator.getWriter().getDirectContent();
    cb.saveState();
    cb.setColorStroke(new BaseColor(m_Color.getRGB()));
    cb.setLineWidth(m_LineWidth);
    cb.moveTo(m_X1, m_Y1);
    cb.lineTo(m_X2, m_Y2);
    cb.stroke();
    cb.restoreState();

    return true;
}

From source file:adams.flow.transformer.pdfproclet.Rectangle.java

License:Open Source License

/**
 * The actual processing of the document.
 *
 * @param generator   the context/*from   w w w.  ja  va  2s  .co m*/
 * @param file   the file to add
 * @return      true if successfully added
 * @throws Exception   if something goes wrong
 */
protected boolean doProcess(PDFGenerator generator, File file) throws Exception {
    PdfContentByte cb;

    cb = generator.getWriter().getDirectContent();
    cb.saveState();
    cb.setColorStroke(new BaseColor(m_Color.getRGB()));
    cb.setColorFill(new BaseColor(m_Color.getRGB()));
    cb.setLineWidth(m_LineWidth);
    cb.rectangle(m_X, m_Y, m_X + m_Width, m_Y + m_Height);
    if (m_Fill)
        cb.fillStroke();
    else
        cb.stroke();
    cb.restoreState();

    return true;
}

From source file:bouttime.report.bracketsheet.BracketSheetUtil.java

License:Open Source License

public static void setLineWidth(PdfContentByte cb, float lineWidth) {
    cb.setLineWidth(lineWidth); // 1.0 default
}

From source file:bouttime.report.bracketsheet.BracketSheetUtil.java

License:Open Source License

public static void setLineWidthGrayStroke(PdfContentByte cb, float lineWidth, float grayStroke) {

    cb.setLineWidth(lineWidth); // 1.0 default
    cb.setGrayStroke(grayStroke); // 0 = black, 1 = white
}

From source file:com.devox.GUI.PDF.ExportarAPDF.java

private static void drawLine(PdfContentByte contentByte) {
    contentByte.saveState();/*from  w w  w .j a va 2 s .c  o m*/
    contentByte.moveTo(550, 795);
    contentByte.lineTo(35, 795);
    contentByte.moveTo(550, 45);
    contentByte.lineTo(35, 45);
    contentByte.setLineWidth(3);
    contentByte.setColorStroke(new BaseColor(252, 204, 41));
    contentByte.stroke();
    contentByte.restoreState();

}

From source file:com.devox.GUI.PDF.ExportarAPDF.java

private static void drawLine2(PdfContentByte contentByte) {
    contentByte.saveState();/*  w w w.ja  va  2 s. c  om*/
    contentByte.moveTo(45, 35);
    contentByte.lineTo(795, 35);
    contentByte.moveTo(45, 550);
    contentByte.lineTo(795, 550);
    contentByte.setLineWidth(3);
    contentByte.setColorStroke(new BaseColor(252, 204, 41));
    contentByte.stroke();
    contentByte.restoreState();

}