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

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

Introduction

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

Prototype


public void setRGBColorStrokeF(final float red, final float green, final float blue) 

Source Link

Document

Changes the current color for stroking paths (device dependent colors!).

Usage

From source file:mkl.testarea.itext5.pdfcleanup.StrictPdfCleanUpProcessor.java

License:Open Source License

private void setStrokeColor(PdfContentByte canvas, List strokeColorArgs) {
    switch (strokeColorArgs.size()) {
    case 1:/*  ww w  .  j av a2  s.  c o m*/
        canvas.setGrayStroke(((PdfNumber) strokeColorArgs.get(0)).floatValue());
        break;

    case 3:
        canvas.setRGBColorStrokeF(((PdfNumber) strokeColorArgs.get(0)).floatValue(),
                ((PdfNumber) strokeColorArgs.get(1)).floatValue(),
                ((PdfNumber) strokeColorArgs.get(2)).floatValue());
        break;

    case 4:
        canvas.setCMYKColorFillF(((PdfNumber) strokeColorArgs.get(0)).floatValue(),
                ((PdfNumber) strokeColorArgs.get(1)).floatValue(),
                ((PdfNumber) strokeColorArgs.get(2)).floatValue(),
                ((PdfNumber) strokeColorArgs.get(3)).floatValue());
        break;

    }
}