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
Nested ClassesModifier and TypeClassDescriptionstatic classShading 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 classWrapper that represents tiling pattern of color space. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPdfPattern(PdfDictionary pdfObject) Wraps the passedPdfDictionary. -
Method Summary
Modifier and TypeMethodDescriptionvoidflush()To manually flush aPdfObjectbehind 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 PdfPatterngetPatternInstance(PdfDictionary pdfObject) Creates the instance wrapper of correct type from thePdfDictionaryprotected booleanDefines if the object behind this wrapper must be an indirect object in the resultant document.voidSets 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- thePdfDictionarythat represent Pattern
-
-
Method Details
-
getPatternInstance
Creates the instance wrapper of correct type from thePdfDictionary- Parameters:
-
pdfObject- thePdfDictionarythat 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 aPdfObjectbehind 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:
-
flushin classPdfObjectWrapper<PdfDictionary>
-
isWrappedObjectMustBeIndirect
protected boolean isWrappedObjectMustBeIndirect()Description copied from class:PdfObjectWrapperDefines 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:
-
isWrappedObjectMustBeIndirectin classPdfObjectWrapper<PdfDictionary> - Returns:
- true if in the resultant document the object behind the wrapper must be indirect, otherwise false.
-