Package com.itextpdf.tool.xml.html.table
Class Table
- java.lang.Object
-
- com.itextpdf.tool.xml.html.AbstractTagProcessor
-
- com.itextpdf.tool.xml.html.table.Table
-
- All Implemented Interfaces:
CssAppliersAware,TagProcessor
public class Table extends AbstractTagProcessor
- Author:
- Emiel Ackermann
-
-
Field Summary
Fields Modifier and Type Field Description static floatDEFAULT_CELL_BORDER_WIDTH
-
Constructor Summary
Constructors Constructor Description Table()Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Element>end(WorkerContext ctx, Tag tag, java.util.List<Element> currentContent)Classes extending AbstractTagProcessor should override this method for actions that should be done inTagProcessor.endElement(WorkerContext, Tag, List).static floatgetBorderOrCellSpacing(boolean getHor, java.util.Map<java.lang.String,java.lang.String> css, java.util.Map<java.lang.String,java.lang.String> attributes)Extracts and parses the style border-spacing or the attribute cellspacing of a table tag, if present.protected PdfPTableintPdfPTable(int numberOfColumn)booleanisStackOwner()Defaults to false.static TableStyleValuessetBorderAttributeForCell(Tag tag)static TableStyleValuessetStyleValues(Tag tag)Set the table style values in aTableStyleValuesobject based on attributes and css of the given tag.-
Methods inherited from class com.itextpdf.tool.xml.html.AbstractTagProcessor
content, createParagraph, currentContentToParagraph, currentContentToParagraph, doRtlIndentCorrections, endElement, getCssAppliers, getCSSResolver, getHtmlPipelineContext, getRunDirection, invertTextAlignForParagraph, invertTextAlignForParagraph, setCssAppliers, start, startElement, textContent, updateParagraphFontIfNeeded
-
-
-
-
Field Detail
-
DEFAULT_CELL_BORDER_WIDTH
public static final float DEFAULT_CELL_BORDER_WIDTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
end
public java.util.List<Element> end(WorkerContext ctx, Tag tag, java.util.List<Element> currentContent)
Description copied from class:AbstractTagProcessorClasses extending AbstractTagProcessor should override this method for actions that should be done inTagProcessor.endElement(WorkerContext, Tag, List). TheAbstractTagProcessor.endElement(WorkerContext, Tag, List)calls this method after or before doing certain stuff, (see it's description).- Overrides:
endin classAbstractTagProcessor- Parameters:
ctx- the WorkerContexttag- the tagcurrentContent- the content created from e.g. inner tags, inner content and not yet added to document.- Returns:
- a List containing iText Element objects
-
intPdfPTable
protected PdfPTable intPdfPTable(int numberOfColumn)
-
setStyleValues
public static TableStyleValues setStyleValues(Tag tag)
Set the table style values in aTableStyleValuesobject based on attributes and css of the given tag.- Parameters:
tag- containing attributes and css.- Returns:
- a
TableStyleValuesobject containing the table's style values.
-
setBorderAttributeForCell
public static TableStyleValues setBorderAttributeForCell(Tag tag)
-
getBorderOrCellSpacing
public static float getBorderOrCellSpacing(boolean getHor, java.util.Map<java.lang.String,java.lang.String> css, java.util.Map<java.lang.String,java.lang.String> attributes)Extracts and parses the style border-spacing or the attribute cellspacing of a table tag, if present. Favors the style border-spacing over the attribute cellspacing.
If style="border-collapse:collapse" is found in the css, the spacing is always 0f.
If no spacing is set, the default of 1.5pt is returned.- Parameters:
getHor- true for horizontal spacing, false for vertical spacing.css- of the table tag.attributes- of the table tag.- Returns:
- horizontal or vertical spacing between two cells or a cell and the border of the table.
-
isStackOwner
public boolean isStackOwner()
Description copied from class:AbstractTagProcessorDefaults to false.- Specified by:
isStackOwnerin interfaceTagProcessor- Overrides:
isStackOwnerin classAbstractTagProcessor- Returns:
- true if the tag implementation must keep it's own currentContent stack.
- See Also:
TagProcessor.isStackOwner()
-
-