public class PdfTemplate extends PdfContentByte implements IAccessibleElement
PdfContentByte.GraphicState
Modifier and Type | Field and Description |
---|---|
protected HashMap<PdfName,PdfObject> |
accessibleAttributes |
protected Rectangle |
bBox
The bounding box of this template
|
protected boolean |
contentTagged |
protected PdfTransparencyGroup |
group |
protected PdfOCG |
layer |
protected PdfArray |
matrix |
protected PdfIndirectReference |
pageReference |
protected com.itextpdf.text.pdf.PageResources |
pageResources
The resources used by this template
|
protected PdfName |
role |
protected PdfIndirectReference |
thisReference
The indirect reference to this template
|
protected int |
type |
static int |
TYPE_IMPORTED |
static int |
TYPE_PATTERN |
static int |
TYPE_TEMPLATE |
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, content, duplicatedFrom, layerDepth, LINE_CAP_BUTT, LINE_CAP_PROJECTING_SQUARE, LINE_CAP_ROUND, LINE_JOIN_BEVEL, LINE_JOIN_MITER, LINE_JOIN_ROUND, markedContentSize, pdf, separator, state, stateList, TEXT_RENDER_MODE_CLIP, TEXT_RENDER_MODE_FILL, TEXT_RENDER_MODE_FILL_CLIP, TEXT_RENDER_MODE_FILL_STROKE, TEXT_RENDER_MODE_FILL_STROKE_CLIP, TEXT_RENDER_MODE_INVISIBLE, TEXT_RENDER_MODE_STROKE, TEXT_RENDER_MODE_STROKE_CLIP, writer
Modifier | Constructor and Description |
---|---|
protected |
PdfTemplate()
Creates a PdfTemplate .
|
Modifier and Type | Method and Description |
---|---|
void |
beginVariableText() |
static PdfTemplate |
createTemplate(PdfWriter writer, float width, float height)
Creates a new template.
|
void |
endVariableText() |
PdfObject |
getAccessibleAttribute(PdfName key)
Get the attribute of accessible element (everything in A dictionary + Lang , Alt , ActualText , E ).
|
HashMap<PdfName,PdfObject> |
getAccessibleAttributes()
Gets all the properties of accessible element.
|
PdfDictionary |
getAdditional()
Getter for the dictionary with additional information.
|
Rectangle |
getBoundingBox() |
PdfIndirectReference |
getCurrentPage() |
PdfContentByte |
getDuplicate()
Gets a duplicate of this PdfTemplate .
|
PdfStream |
getFormXObject(int compressionLevel)
Gets the stream representing this template.
|
PdfTransparencyGroup |
getGroup()
Getter for property group.
|
float |
getHeight()
Gets the bounding height of this template.
|
AccessibleElementId |
getId() |
PdfIndirectReference |
getIndirectReference()
Gets the indirect reference to this template.
|
PdfOCG |
getLayer()
Gets the layer this template belongs to.
|
PdfIndirectReference |
getPageReference() |
PdfName |
getRole()
Gets the role of the accessible element.
|
int |
getType() |
float |
getWidth()
Gets the bounding width of this template.
|
boolean |
isContentTagged() |
boolean |
isInline() |
boolean |
isTagged()
Checks if the content needs to be tagged.
|
void |
setAccessibleAttribute(PdfName key, PdfObject value)
Set the attribute of accessible element (everything in A dictionary + Lang , Alt , ActualText , E ).
|
void |
setAdditional(PdfDictionary additional)
Sets a dictionary with extra entries, for instance /Measure.
|
void |
setBoundingBox(Rectangle bBox) |
void |
setContentTagged(boolean contentTagged) |
void |
setGroup(PdfTransparencyGroup group)
Setter for property group.
|
void |
setHeight(float height)
Sets the bounding height of this template.
|
void |
setId(AccessibleElementId id) |
void |
setLayer(PdfOCG layer)
Sets the layer this template belongs to.
|
void |
setMatrix(float a, float b, float c, float d, float e, float f) |
void |
setPageReference(PdfIndirectReference pageReference) |
void |
setRole(PdfName role)
Sets the role of the accessiblee element.
|
void |
setWidth(float width)
Sets the bounding width of this template.
|
add, addAnnotation, addFormXObj, addFormXObj, addImage, addImage, addImage, addImage, addImage, addImage, addImage, addImage, addImage, addOutline, addPSXObject, addTemplate, addTemplate, addTemplate, addTemplate, addTemplate, addTemplate, addTemplate, addTemplate, addTemplate, addTemplate, addTemplate, arc, arc, beginLayer, beginMarkedContentSequence, beginMarkedContentSequence, beginMarkedContentSequence, beginText, beginText, bezierArc, bezierArc, checkState, checkWriter, circle, circle, clip, closeMCBlock, closePath, closePathEoFillStroke, closePathFillStroke, closePathStroke, concatCTM, concatCTM, concatCTM, concatCTM, createAppearance, createGraphics, createGraphics, createGraphics, createGraphics, createGraphicsShapes, createGraphicsShapes, createPattern, createPattern, createPattern, createPattern, createPrinterGraphics, createPrinterGraphics, createPrinterGraphics, createPrinterGraphics, createPrinterGraphicsShapes, createPrinterGraphicsShapes, createTemplate, curveFromTo, curveFromTo, curveTo, curveTo, curveTo, curveTo, drawButton, drawButton, drawRadioField, drawRadioField, drawTextField, drawTextField, ellipse, ellipse, endLayer, endMarkedContentSequence, endText, eoClip, eoFill, eoFillStroke, fill, fillStroke, getCharacterSpacing, getDuplicate, getEffectiveStringWidth, getHorizontalScaling, getInternalBuffer, getInText, getKernArray, getLeading, getMcDepth, getMcElements, getPdfDocument, getPdfWriter, getRootOutline, getWordSpacing, getXTLM, getYTLM, inheritGraphicState, isTaggingSuppressed, lineTo, lineTo, localDestination, localGoto, moveText, moveTextWithLeading, moveTo, moveTo, newlineShowText, newlineShowText, newlineText, newPath, openMCBlock, paintShading, paintShading, rectangle, rectangle, rectangle, remoteGoto, remoteGoto, reset, reset, resetCMYKColorFill, resetCMYKColorStroke, resetGrayFill, resetGrayStroke, resetRGBColorFill, resetRGBColorStroke, restoreMCBlocks, restoreState, roundRectangle, roundRectangle, sanityCheck, saveMCBlocks, saveState, setAction, setCharacterSpacing, setCMYKColorFill, setCMYKColorFillF, setCMYKColorStroke, setCMYKColorStrokeF, setColorFill, setColorFill, setColorFill, setColorFill, setColorStroke, setColorStroke, setColorStroke, setColorStroke, setDefaultColorspace, setFlatness, setFlatness, setFontAndSize, setGrayFill, setGrayStroke, setGState, setHorizontalScaling, setLeading, setLineCap, setLineDash, setLineDash, setLineDash, setLineDash, setLineDash, setLineDash, setLineDash, setLineDash, setLineJoin, setLineWidth, setLineWidth, setLiteral, setLiteral, setLiteral, setMcDepth, setMcElements, setMiterLimit, setMiterLimit, setPatternFill, setPatternFill, setPatternFill, setPatternStroke, setPatternStroke, setPatternStroke, setRenderingIntent, setRGBColorFill, setRGBColorFillF, setRGBColorStroke, setRGBColorStrokeF, setShadingFill, setShadingStroke, setSuppressTagging, setTextMatrix, setTextMatrix, setTextMatrix, setTextMatrix, setTextRenderingMode, setTextRise, setTextRise, setWordSpacing, showText, showText, showTextAligned, showTextAlignedKerned, showTextGid, showTextKerned, stroke, toPdf, toString, transform, transform, updateTx, variableRectangle
public static final int TYPE_TEMPLATE
public static final int TYPE_IMPORTED
public static final int TYPE_PATTERN
protected int type
protected PdfIndirectReference thisReference
protected com.itextpdf.text.pdf.PageResources pageResources
protected Rectangle bBox
protected PdfArray matrix
protected PdfTransparencyGroup group
protected PdfOCG layer
protected PdfIndirectReference pageReference
protected boolean contentTagged
protected PdfName role
public static PdfTemplate createTemplate(PdfWriter writer, float width, float height)
Creates a new template that is nothing more than a form XObject. This template can be included in this template or in another template. Templates are only written to the output when the document is closed permitting things like showing text in the first page that is only defined in the last page.
writer
- the PdfWriter to use
width
- the bounding box width
height
- the bounding box height
public boolean isTagged()
PdfContentByte
isTagged
in class PdfContentByte
public void setWidth(float width)
width
- the bounding width
public void setHeight(float height)
height
- the bounding height
public float getWidth()
public float getHeight()
public Rectangle getBoundingBox()
public void setBoundingBox(Rectangle bBox)
public void setLayer(PdfOCG layer)
layer
- the layer this template belongs to
public PdfOCG getLayer()
null
for no layer defined
public void setMatrix(float a, float b, float c, float d, float e, float f)
public PdfIndirectReference getIndirectReference()
public void beginVariableText()
public void endVariableText()
public PdfStream getFormXObject(int compressionLevel) throws IOException
compressionLevel
- the compressionLevel
IOException
public PdfContentByte getDuplicate()
PdfTemplate
. All the members are copied by reference but the buffer stays different.
getDuplicate
in class PdfContentByte
PdfTemplate
public int getType()
public PdfTransparencyGroup getGroup()
public void setGroup(PdfTransparencyGroup group)
group
- New value of property group.
public PdfDictionary getAdditional()
public void setAdditional(PdfDictionary additional)
additional
- a PdfDictionary with additional information.
public PdfIndirectReference getCurrentPage()
getCurrentPage
in class PdfContentByte
public PdfIndirectReference getPageReference()
public void setPageReference(PdfIndirectReference pageReference)
public boolean isContentTagged()
public void setContentTagged(boolean contentTagged)
public PdfObject getAccessibleAttribute(PdfName key)
IAccessibleElement
A
dictionary + Lang
, Alt
, ActualText
, E
).
getAccessibleAttribute
in interface IAccessibleElement
public void setAccessibleAttribute(PdfName key, PdfObject value)
IAccessibleElement
A
dictionary + Lang
, Alt
, ActualText
, E
).
setAccessibleAttribute
in interface IAccessibleElement
public HashMap<PdfName,PdfObject> getAccessibleAttributes()
IAccessibleElement
getAccessibleAttributes
in interface IAccessibleElement
public PdfName getRole()
IAccessibleElement
getRole
in interface IAccessibleElement
public void setRole(PdfName role)
IAccessibleElement
null
if you don't want to tag this element. Note that all child elements won't also be tagged.
setRole
in interface IAccessibleElement
public AccessibleElementId getId()
getId
in interface IAccessibleElement
public void setId(AccessibleElementId id)
setId
in interface IAccessibleElement
public boolean isInline()
isInline
in interface IAccessibleElement
Copyright © 1998–2017. All rights reserved.