Example usage for com.lowagie.text.pdf PdfTemplate setCMYKColorFill

List of usage examples for com.lowagie.text.pdf PdfTemplate setCMYKColorFill

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfTemplate setCMYKColorFill.

Prototype


public void setCMYKColorFill(int cyan, int magenta, int yellow, int black) 

Source Link

Document

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

Usage

From source file:org.xhtmlrenderer.pdf.AbstractFormField.java

License:Open Source License

protected void setFillColor(PdfTemplate template, FSColor color) {
    if (color instanceof FSRGBColor) {
        FSRGBColor rgb = (FSRGBColor) color;
        template.setRGBColorFill(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
    } else if (color instanceof FSCMYKColor) {
        FSCMYKColor cmyk = (FSCMYKColor) color;
        template.setCMYKColorFill((int) (cmyk.getCyan() * 255), (int) (cmyk.getMagenta() * 255),
                (int) (cmyk.getYellow() * 255), (int) (cmyk.getBlack() * 255));
    }//  ww w .  j av a  2 s. c  o  m
}