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 Paint
create(Document targetDocument, ColorSpace colorSpace, double[] color, Transparency transparency)
Create an new paint.double[]
getColor()
The color values of this paint.ColorSpace
getColorSpace()
The color space of this paint.Transparency
getTransparency()
The transparency parameters of this paint ornull
if 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. Usenull
to create an opaque paint.- Returns:
- newly created paint object
- Throws:
ConformanceException
- if thetransparency
argument is notnull
andTransparency.getAlpha()
oftransparency
is not 1.0 and the explicitly specified conformance does not support transparency (PDF/A-1, PDF 1.0 - 1.3).ConformanceException
- if thetransparency
argument is notnull
andTransparency.getBlendMode()
is notBlendMode.NORMAL
and the explicitly specified conformance does not support transparency (PDF/A-1, PDF 1.0 - 1.3).java.lang.IllegalArgumentException
- if thetargetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- if thecolorSpace
object has already been closedjava.lang.IllegalArgumentException
- if thecolorSpace
is associated with a different documentjava.lang.IllegalArgumentException
- if thecolor
argument contains too few elementsjava.lang.IllegalArgumentException
- if an element of thecolor
argument is out of rangejava.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- ifcolorSpace
isnull
java.lang.IllegalArgumentException
- ifcolor
isnull
-
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 ornull
if 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.
-
-