Class PdfPattern.Tiling
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.colorspace.PdfPattern
com.itextpdf.kernel.pdf.colorspace.PdfPattern.Tiling
- Enclosing class:
- PdfPattern
Wrapper that represents tiling pattern of color space. This pattern consists of a small graphical figure (cells). Painting with the pattern replicates the cell at fixed horizontal and vertical intervals to fill an area. The pattern cell can include graphical elements such as filled areas, text, and sampled images. Its shape need not be rectangular, and the spacing of tiles can differ from the dimensions of the cell itself. The appearance of the pattern cell shall be defined by a content stream containing the painting operators needed to paint one instance of the cell
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA code that determines how the colour of the pattern cell shall be specifiedstatic classA code that controls adjustments to the spacing of tiles relative to the device pixel gridNested classes/interfaces inherited from class com.itextpdf.kernel.pdf.colorspace.PdfPattern
PdfPattern.Shading, PdfPattern.Tiling -
Constructor Summary
ConstructorsConstructorDescriptionTiling(float width, float height) Creates a new Tiling Pattern instance.Tiling(float width, float height, boolean colored) Creates a new Tiling Pattern instance.Tiling(float width, float height, float xStep, float yStep) Creates a new Tiling Pattern instance.Tiling(float width, float height, float xStep, float yStep, boolean colored) Creates a new Tiling Pattern instance.Creates a new Tiling instance.Creates a new Tiling instance.Creates a new Tiling instance.Creates a new Tiling instance.Creates new instance from thePdfStreamobject. -
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.getBBox()Gets the pattern cell's bounding box.Gets the Tiling Pattern's resources.intGets the tiling type.floatgetXStep()Gets the desired horizontal space between pattern cells.floatgetYStep()Gets the desired vertical space between pattern cells.booleanChecks if this pattern have colored paint type.voidSets the pattern cell's bounding box.voidsetColored(boolean colored) Sets the paint type.voidsetTilingType(int tilingType) Sets the tiling type.voidsetXStep(float xStep) Sets the desired horizontal space between pattern cells.voidsetYStep(float yStep) Sets the desired vertical space between pattern cells.Methods inherited from class com.itextpdf.kernel.pdf.colorspace.PdfPattern
getMatrix, getPatternInstance, isWrappedObjectMustBeIndirect, setMatrixMethods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
Constructor Details
-
Tiling
Creates new instance from thePdfStreamobject. This stream should have PatternType equals to 1.- Parameters:
-
pdfObject- thePdfStreamthat represents Tiling Pattern.
-
Tiling
public Tiling(float width, float height) Creates a new Tiling Pattern instance.By default the pattern will be colored.
- Parameters:
-
width- the width of the pattern cell's bounding box -
height- the height of the pattern cell's bounding box
-
Tiling
public Tiling(float width, float height, boolean colored) Creates a new Tiling Pattern instance.- Parameters:
-
width- the width of the pattern cell's bounding box -
height- the height of the pattern cell's bounding box -
colored- defines whether the Tiling Pattern will be colored or not
-
Tiling
Creates a new Tiling instance.By default the pattern will be colored.
- Parameters:
-
bbox- the pattern cell's bounding box
-
Tiling
Creates a new Tiling instance.- Parameters:
-
bbox- the pattern cell's bounding box -
colored- defines whether the Tiling Pattern will be colored or not
-
Tiling
public Tiling(float width, float height, float xStep, float yStep) Creates a new Tiling Pattern instance.By default the pattern will be colored.
- Parameters:
-
width- the width of the pattern cell's bounding box -
height- the height of the pattern cell's bounding box -
xStep- the desired horizontal space between pattern cells -
yStep- the desired vertical space between pattern cells
-
Tiling
public Tiling(float width, float height, float xStep, float yStep, boolean colored) Creates a new Tiling Pattern instance.- Parameters:
-
width- the width of the pattern cell's bounding box -
height- the height of the pattern cell's bounding box -
xStep- the desired horizontal space between pattern cells -
yStep- the desired vertical space between pattern cells -
colored- defines whether the Tiling Pattern will be colored or not
-
Tiling
Creates a new Tiling instance.By default the pattern will be colored.
- Parameters:
-
bbox- the pattern cell's bounding box -
xStep- the desired horizontal space between pattern cells -
yStep- the desired vertical space between pattern cells
-
Tiling
Creates a new Tiling instance.- Parameters:
-
bbox- the pattern cell's bounding box -
xStep- the desired horizontal space between pattern cells -
yStep- the desired vertical space between pattern cells -
colored- defines whether the Tiling Pattern will be colored or not
-
-
Method Details
-
isColored
public boolean isColored()Checks if this pattern have colored paint type.- Returns:
-
trueif this pattern's paint type isPdfPattern.Tiling.PaintType.COLOREDandfalseotherwise.
-
setColored
public void setColored(boolean colored) Sets the paint type.- Parameters:
-
colored- iftruethen the paint type will be set asPdfPattern.Tiling.PaintType.COLORED, andPdfPattern.Tiling.PaintType.UNCOLOREDotherwise.
-
getTilingType
public int getTilingType()Gets the tiling type.- Returns:
-
int value of
PdfPattern.Tiling.TilingType
-
setTilingType
public void setTilingType(int tilingType) Sets the tiling type.- Parameters:
-
tilingType- int value ofPdfPattern.Tiling.TilingTypeto set. - Throws:
-
IllegalArgumentException- in case of wrong value.
-
getBBox
Gets the pattern cell's bounding box. These boundaries shall be used to clip the pattern cell.- Returns:
- pattern cell's bounding box.
-
setBBox
Sets the pattern cell's bounding box. These boundaries shall be used to clip the pattern cell.- Parameters:
-
bbox- pattern cell's bounding box to set.
-
getXStep
public float getXStep()Gets the desired horizontal space between pattern cells.- Returns:
- the desired horizontal space between pattern cells
-
setXStep
public void setXStep(float xStep) Sets the desired horizontal space between pattern cells.- Parameters:
-
xStep- the desired horizontal space between pattern cells
-
getYStep
public float getYStep()Gets the desired vertical space between pattern cells.- Returns:
- the desired vertical space between pattern cells
-
setYStep
public void setYStep(float yStep) Sets the desired vertical space between pattern cells.- Parameters:
-
yStep- the desired vertical space between pattern cells
-
getResources
Gets the Tiling Pattern's resources.- Returns:
- the Tiling Pattern's resources
-
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 classPdfPattern
-