Package com.pdftools.toolbox.pdf.content
Class Paint
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.content.Paint
-
public class Paint extends NativeObject
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Paintcreate(Document targetDocument, ColorSpace colorSpace, double[] color, Transparency transparency)Create an new paint.double[]getColor()The color values of this paint.ColorSpacegetColorSpace()The color space of this paint.TransparencygetTransparency()The transparency parameters of this paint ornullif this paint is opaque.-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
create
public static Paint create(Document targetDocument, ColorSpace colorSpace, double[] color, Transparency transparency) throws ConformanceException
Create an new paint.
Transparency is supported by PDF 1.4 or higher and by PDF/A-2 or higher. The returned paint object is not yet used on any page, but it is associated with the given target document.- Parameters:
targetDocument- the output document with which the returned object is associatedcolorSpace- the color space of the paintcolor- the color componentstransparency- the transparency parameters. Usenullto create an opaque paint.- Returns:
- newly created paint object
- Throws:
ConformanceException- if thetransparencyargument is notnullandTransparency.getAlpha()oftransparencyis not 1.0 and the explicitly specified conformance does not support transparency (PDF/A-1, PDF 1.0 - 1.3).ConformanceException- if thetransparencyargument is notnullandTransparency.getBlendMode()is notBlendMode.NORMALand the explicitly specified conformance does not support transparency (PDF/A-1, PDF 1.0 - 1.3).java.lang.IllegalArgumentException- if thetargetDocumentargument has already been closedjava.lang.IllegalArgumentException- if thetargetDocumentargument is read-onlyjava.lang.IllegalArgumentException- if thecolorSpaceobject has already been closedjava.lang.IllegalArgumentException- if thecolorSpaceis associated with a different documentjava.lang.IllegalArgumentException- if thecolorargument contains too few elementsjava.lang.IllegalArgumentException- if an element of thecolorargument is out of rangejava.lang.IllegalArgumentException- iftargetDocumentisnulljava.lang.IllegalArgumentException- ifcolorSpaceisnulljava.lang.IllegalArgumentException- ifcolorisnull
-
getColorSpace
public ColorSpace getColorSpace()
The color space of this paint.- Throws:
java.lang.IllegalStateException- the object has already been closedjava.lang.IllegalStateException- the object has been created with any creation method of the document.
-
getColor
public double[] getColor()
The color values of this paint.- Throws:
java.lang.IllegalStateException- the object has already been closedjava.lang.IllegalStateException- the object has been created with any creation method of the document.
-
getTransparency
public Transparency getTransparency()
The transparency parameters of this paint ornullif this paint is opaque.- Throws:
java.lang.IllegalStateException- the object has already been closedjava.lang.IllegalStateException- the object has been created with any creation method of the document.
-
-