Class PdfPattern
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.colorspace.PdfPattern
- Direct Known Subclasses:
-
PdfPattern.Shading
,PdfPattern.Tiling
Dictionary wrapper that represent special type of color space, that uses pattern objects as the equivalent of colour values instead of the numeric component values used with other spaces. A pattern object shall be a dictionary or a stream, depending on the type of pattern. For mor information see paragraph 8.7 in ISO-32000-1.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Shading pattern provides a smooth transition between colors across an area to be painted, independent of the resolution of any particular output device and without specifying the number of steps in the color transition.static class
Wrapper that represents tiling pattern of color space. -
Constructor Summary
ModifierConstructorDescriptionprotected
PdfPattern
(PdfDictionary pdfObject) Wraps the passedPdfDictionary
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
To manually flush aPdfObject
behind this wrapper, you have to ensure that this object is added to the document, i.e.Gets a transformation matrix that maps the pattern’s internal coordinate system to the default coordinate system of the pattern’s parent content stream.static PdfPattern
getPatternInstance
(PdfDictionary pdfObject) Creates the instance wrapper of correct type from thePdfDictionary
protected boolean
Defines if the object behind this wrapper must be an indirect object in the resultant document.void
Sets a transformation matrix that maps the pattern’s internal coordinate system to the default coordinate system of the pattern’s parent content stream.Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
Constructor Details
-
PdfPattern
Wraps the passedPdfDictionary
.- Parameters:
-
pdfObject
- thePdfDictionary
that represent Pattern
-
-
Method Details
-
getPatternInstance
Creates the instance wrapper of correct type from thePdfDictionary
- Parameters:
-
pdfObject
- thePdfDictionary
that represent Pattern - Returns:
- new wrapper instance.
-
getMatrix
Gets a transformation matrix that maps the pattern’s internal coordinate system to the default coordinate system of the pattern’s parent content stream. The concatenation of the pattern matrix with that of the parent content stream establishes the pattern coordinate space, within which all graphics objects in the pattern shall be interpreted.- Returns:
- pattern matrix
-
setMatrix
Sets a transformation matrix that maps the pattern’s internal coordinate system to the default coordinate system of the pattern’s parent content stream. The concatenation of the pattern matrix with that of the parent content stream establishes the pattern coordinate space, within which all graphics objects in the pattern shall be interpreted.- Parameters:
-
matrix
- pattern matrix to set
-
flush
public void flush()To manually flush aPdfObject
behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference. Basically this means that before flushing you need to explicitly callPdfObjectWrapper.makeIndirect(PdfDocument)
. For example: wrapperInstance.makeIndirect(document).flush(); Note that not every wrapper require this, only those that have such warning in documentation.- Overrides:
-
flush
in classPdfObjectWrapper<PdfDictionary>
-
isWrappedObjectMustBeIndirect
protected boolean isWrappedObjectMustBeIndirect()Description copied from class:PdfObjectWrapper
Defines if the object behind this wrapper must be an indirect object in the resultant document.
If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.
Return value of this method shouldn't depend on any logic, it should return always true or false.- Specified by:
-
isWrappedObjectMustBeIndirect
in classPdfObjectWrapper<PdfDictionary>
- Returns:
- true if in the resultant document the object behind the wrapper must be indirect, otherwise false.
-