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
Modifier and TypeClassDescriptionstatic class
A code that determines how the colour of the pattern cell shall be specifiedstatic class
A 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
ConstructorDescriptionTiling
(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 thePdfStream
object. -
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.getBBox()
Gets the pattern cell's bounding box.Gets the Tiling Pattern's resources.int
Gets the tiling type.float
getXStep()
Gets the desired horizontal space between pattern cells.float
getYStep()
Gets the desired vertical space between pattern cells.boolean
Checks if this pattern have colored paint type.void
Sets the pattern cell's bounding box.void
setColored
(boolean colored) Sets the paint type.void
setTilingType
(int tilingType) Sets the tiling type.void
setXStep
(float xStep) Sets the desired horizontal space between pattern cells.void
setYStep
(float yStep) Sets the desired vertical space between pattern cells.Methods inherited from class com.itextpdf.kernel.pdf.colorspace.PdfPattern
getMatrix, getPatternInstance, isWrappedObjectMustBeIndirect, setMatrix
Methods 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 thePdfStream
object. This stream should have PatternType equals to 1.- Parameters:
-
pdfObject
- thePdfStream
that 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:
-
true
if this pattern's paint type isPdfPattern.Tiling.PaintType.COLORED
andfalse
otherwise.
-
setColored
public void setColored(boolean colored) Sets the paint type.- Parameters:
-
colored
- iftrue
then the paint type will be set asPdfPattern.Tiling.PaintType.COLORED
, andPdfPattern.Tiling.PaintType.UNCOLORED
otherwise.
-
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.TilingType
to 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 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 classPdfPattern
-