Click or drag to resize
Pdftools logo

PaintCreate Method

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.

Namespace: PdfTools.Toolbox.Pdf.Content
Assembly: PdfTools.Toolbox (in PdfTools.Toolbox.dll) Version: 1.0.0+fdabb036503e9f99735634a6d4f5be875399e9f5
Syntax
C#
public static Paint Create(
	Document targetDocument,
	ColorSpace colorSpace,
	double[] color,
	Transparency transparency
)

Parameters

targetDocument  Document
the output document with which the returned object is associated
colorSpace  ColorSpace
the color space of the paint
color  Double
the color components
transparency  Transparency
the transparency parameters. Use to create an opaque paint.

Return Value

Paint
newly created paint object
Exceptions
ExceptionCondition
ConformanceExceptionif the transparency argument is not and Alpha of transparency is not 1.0 and the explicitly specified conformance does not support transparency (PDF/A-1, PDF 1.0 - 1.3).
ConformanceExceptionif the transparency argument is not and BlendMode is not Normal and the explicitly specified conformance does not support transparency (PDF/A-1, PDF 1.0 - 1.3).
ArgumentExceptionif the targetDocument argument has already been closed
ArgumentExceptionif the targetDocument argument is read-only
ArgumentExceptionif the colorSpace object has already been closed
ArgumentExceptionif the colorSpace is associated with a different document
ArgumentExceptionif the color argument contains too few elements
ArgumentExceptionif an element of the color argument is out of range
ArgumentNullExceptionif targetDocument is .
ArgumentNullExceptionif colorSpace is .
ArgumentNullExceptionif color is .
See Also