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

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

Introduction

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

Prototype


public void setGrayFill(final float gray) 

Source Link

Document

Changes the currentgray tint for filling paths (device dependent colors!).

Usage

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

License:Open Source License

private void setFillColor(PdfContentByte canvas, List fillColorArgs) {
    switch (fillColorArgs.size()) {
    case 1:// w ww  . j  a  v  a2s. c  o  m
        canvas.setGrayFill(((PdfNumber) fillColorArgs.get(0)).floatValue());
        break;

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

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

    }
}