itextpdf 简介
itextpdf 簡介
? ? ? ? ? ? ? ? ? ? ? ? ??
官網:iText 7
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ??
*********************
簡 介
? ? ? ? ? ? ?
iText 7 is the latest version of iText's powerful PDF Toolkit for PDF generation, PDF programming, handling & manipulation, such as digital signing and more # itext7是itext最新的pdf處理工具,可以用來生成pdf文檔、pdf編程、執行數字簽名等其他操作? ? ? ? ? ? ? ? ? ? ? ? ??
itext7-core:包含很多itext開發所需的包
<dependency><groupId>com.itextpdf</groupId><artifactId>itext7-core</artifactId><version>7.2.0</version><type>pom</type> </dependency>? ? ? ? ? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? ? ??
*********************
相關類與接口
? ? ? ? ? ? ?
PdfDocument
public class PdfDocument implements IEventDispatcher, Closeable {private static IPdfPageFactory pdfPageFactory = new PdfPageFactory();private PageSize defaultPageSize; //pdf頁面大小protected EventDispatcher eventDispatcher;protected PdfWriter writer; //寫入pdf文件protected PdfReader reader; //讀取pdf文件protected byte[] xmpMetadata;protected PdfCatalog catalog;protected PdfDictionary trailer; //pdf字典:內有map,key為pdfName、value為pdf對象protected PdfDocumentInfo info; //pdf文檔信息:作者、標題、關鍵字、創建時間等protected PdfVersion pdfVersion; //pdf版本private PdfString originalDocumentId;private PdfString modifiedDocumentId;final PdfXrefTable xref;protected FingerPrint fingerPrint;protected final StampingProperties properties;protected PdfStructTreeRoot structTreeRoot;protected int structParentIndex;protected boolean closeReader;protected boolean closeWriter;protected boolean isClosing;protected boolean closed;protected boolean flushUnusedObjects;private Map<PdfIndirectReference, PdfFont> documentFonts;private PdfFont defaultFont;protected TagStructureContext tagStructureContext;private SequenceId documentId;private LinkedHashMap<PdfPage, List<PdfLinkAnnotation>> linkAnnotations;Map<PdfIndirectReference, byte[]> serializedObjectsCache;MemoryLimitsAwareHandler memoryLimitsAwareHandler;private EncryptedEmbeddedStreamsHandler encryptedEmbeddedStreamsHandler;*********** 構造方法public PdfDocument(PdfReader reader) {public PdfDocument(PdfReader reader, DocumentProperties properties) {public PdfDocument(PdfWriter writer) {public PdfDocument(PdfWriter writer, DocumentProperties properties) {public PdfDocument(PdfReader reader, PdfWriter writer) {public PdfDocument(PdfReader reader, PdfWriter writer, StampingProperties properties) {*********** XmpMetadataprotected void setXmpMetadata(byte[] xmpMetadata) {public void setXmpMetadata(XMPMeta xmpMeta, SerializeOptions serializeOptions) throws XMPException {public void setXmpMetadata(XMPMeta xmpMeta) throws XMPException {public byte[] getXmpMetadata() {public byte[] getXmpMetadata(boolean createNew) {*********** pdfObjectpublic PdfObject getPdfObject(int objNum) {public int getNumberOfPdfObjects() {*********** pagepublic PdfPage getPage(int pageNum) {public PdfPage getPage(PdfDictionary pageDictionary) {public PdfPage getFirstPage() {public PdfPage getLastPage() {public PdfPage addNewPage() {public PdfPage addNewPage(PageSize pageSize) {public PdfPage addNewPage(int index) {public PdfPage addNewPage(int index, PageSize pageSize) {public PdfPage addPage(PdfPage page) {public PdfPage addPage(int index, PdfPage page) {public int getNumberOfPages() {public int getPageNumber(PdfPage page) {public int getPageNumber(PdfDictionary pageDictionary) {public boolean movePage(PdfPage page, int insertBefore) {public void movePage(int pageNumber, int insertBefore) {public boolean removePage(PdfPage page) {public void removePage(int pageNum) {public List<PdfPage> copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument, int insertBeforePage) {public List<PdfPage> copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument, int insertBeforePage, IPdfPageExtraCopier copier) {public List<PdfPage> copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument) {public List<PdfPage> copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument, IPdfPageExtraCopier copier) {public List<PdfPage> copyPagesTo(List<Integer> pagesToCopy, PdfDocument toDocument, int insertBeforePage) {public List<PdfPage> copyPagesTo(List<Integer> pagesToCopy, PdfDocument toDocument, int insertBeforePage, IPdfPageExtraCopier copier) {public List<PdfPage> copyPagesTo(List<Integer> pagesToCopy, PdfDocument toDocument) {public List<PdfPage> copyPagesTo(List<Integer> pagesToCopy, PdfDocument toDocument, IPdfPageExtraCopier copier) {public PageSize getDefaultPageSize() {public void setDefaultPageSize(PageSize pageSize) {public void flushCopiedObjects(PdfDocument sourceDoc) {*********** fontpublic PdfFont getFont(PdfDictionary dictionary) {public PdfFont getDefaultFont() {public PdfFont addFont(PdfFont font) {public PdfFont findFont(String fontProgram, String encoding) {*********** 文檔信息public PdfDocumentInfo getDocumentInfo() {public PdfString getOriginalDocumentId() {public PdfString getModifiedDocumentId() {public long getDocumentId() {public SequenceId getDocumentIdWrapper() {*********** eventpublic void addEventHandler(String type, IEventHandler handler) {public void dispatchEvent(Event event) {public void dispatchEvent(Event event, boolean delayed) {public boolean hasEventHandler(String type) {public void removeEventHandler(String type, IEventHandler handler) {public void removeAllHandlers() {*********** reader、writerpublic PdfWriter getWriter() {public PdfReader getReader() {*********** 其他操作public PdfCatalog getCatalog() {public String[] getPageLabels() {public PdfVersion getPdfVersion() {public PdfDictionary getTrailer() {public FingerPrint getFingerPrint() {public int getNextStructParentIndex() {public PdfStructTreeRoot getStructTreeRoot() {public TagStructureContext getTagStructureContext() {public PdfOutline getOutlines(boolean updateOutlines) {public boolean isClosed() {public boolean isTagged() {public boolean isAppendMode() {public boolean isCloseReader() {public boolean isCloseWriter() {public boolean isFlushUnusedObjects() {public void close() {public PdfDocument setTagged() {public void setCloseReader(boolean closeReader) {public void setCloseWriter(boolean closeWriter) {public void setFlushUnusedObjects(boolean flushUnusedObjects) {public boolean hasOutlines() {public void initializeOutlines() {public void addFileAttachment(String key, PdfFileSpec fs) {public void addAssociatedFile(String description, PdfFileSpec fs) {public PdfArray getAssociatedFiles() {public PdfEncryptedPayloadDocument getEncryptedPayloadDocument() {public void setEncryptedPayload(PdfFileSpec fs) {public PdfIndirectReference createNextIndirectReference() {public List<PdfIndirectReference> listIndirectReferences() {public void addNamedDestination(String key, PdfObject value) {public void addOutputIntent(PdfOutputIntent outputIntent) {public void checkIsoConformance(Object obj, IsoKey key) {public void checkIsoConformance(Object obj, IsoKey key, PdfResources resources, PdfStream contentStream) {public void checkShowTextIsoConformance(CanvasGraphicsState gState, PdfResources resources) {public void setUserProperties(boolean userProperties) {public boolean registerProduct(ProductData productData) {public void markStreamAsEmbeddedFile(PdfStream stream) {PdfXrefTable getXref() {boolean isDocumentFont(PdfIndirectReference indRef) {boolean hasAcroForm() {boolean doesStreamBelongToEmbeddedFile(PdfStream stream) {protected void initTagStructureContext() {protected void storeLinkAnnotation(PdfPage page, PdfLinkAnnotation annotation) {protected void checkIsoConformance() {protected void markObjectAsMustBeFlushed(PdfObject pdfObject) {protected void flushObject(PdfObject pdfObject, boolean canBeInObjStm) throws IOException {protected void open(PdfVersion newPdfVersion) {protected void addCustomMetadataExtensions(XMPMeta xmpMeta) {protected void updateXmpMetadata() {protected XMPMeta updateDefaultXmpMetadata() throws XMPException {protected Collection<PdfFont> getDocumentFonts() {protected void flushFonts() {protected void checkClosingStatus() {protected IPdfPageFactory getPageFactory() {protected void checkAndAddPage(PdfPage page) {protected void checkAndAddPage(int index, PdfPage page) {protected void tryInitTagStructure(PdfDictionary str) {private void tryFlushTagStructure(boolean isAppendMode) {private void updateValueInMarkInfoDict(PdfName key, PdfObject value) {private void removeUnusedWidgetsFromFields(PdfPage page) {private void copyLinkAnnotations(PdfDocument toDocument, Map<PdfPage, PdfPage> page2page) {private void copyOutlines(Set<PdfOutline> outlines, PdfDocument toDocument, Map<PdfPage, PdfPage> page2page) {private void getAllOutlinesToCopy(PdfOutline outline, Set<PdfOutline> outlinesToCopy) {private void cloneOutlines(Set<PdfOutline> outlinesToCopy, PdfOutline newParent, PdfOutline oldParent, Map<PdfPage, PdfPage> page2page, PdfDocument toDocument) {private void ensureTreeRootAddedToNames(PdfObject treeRoot, PdfName treeType) {private boolean writerHasEncryption() {private void updatePdfVersionFromCatalog() {private void readDocumentIds() {private void processReadingError(String errorMessage) {private static void overrideFullCompressionInWriterProperties(WriterProperties properties, boolean readerHasXrefStream) {private static boolean isXmpMetaHasProperty(XMPMeta xmpMeta, String schemaNS, String propName) throws XMPException {? ? ? ? ? ? ? ? ? ? ? ?
Document
public class Document extends RootElement<Document> {******* 構造方法public Document(PdfDocument pdfDoc) {public Document(PdfDocument pdfDoc, PageSize pageSize) {public Document(PdfDocument pdfDoc, PageSize pageSize, boolean immediateFlush) {******* 普通方法public Document add(AreaBreak areaBreak) {public Document add(IBlockElement element) {public void setRenderer(DocumentRenderer documentRenderer) {public float getTopMargin() {public float getLeftMargin() {public float getRightMargin() {public float getBottomMargin() {public void setTopMargin(float topMargin) {public void setLeftMargin(float leftMargin) {public void setRightMargin(float rightMargin) {public void setBottomMargin(float bottomMargin) {public void setMargins(float topMargin, float rightMargin, float bottomMargin, float leftMargin) {public PdfDocument getPdfDocument() {public <T1> T1 getDefaultProperty(int property) {public Rectangle getPageEffectiveArea(PageSize pageSize) {public void flush() {public void relayout() {public void close() {if (this.rootRenderer != null) {this.rootRenderer.close();}this.pdfDocument.close();}protected RootRenderer ensureRootRendererNotNull() {protected void checkClosingStatus() {? ? ? ? ? ? ? ? ? ? ? ? ??
RootElement
public abstract class RootElement<T extends IPropertyContainer> extends ElementPropertyContainer<T> implements Closeable {protected boolean immediateFlush = true;protected PdfDocument pdfDocument; //pdf文檔protected List<IElement> childElements = new ArrayList();protected PdfFont defaultFont;protected FontProvider defaultFontProvider;protected ISplitCharacters defaultSplitCharacters;protected RootRenderer rootRenderer;private LayoutTaggingHelper defaultLayoutTaggingHelper;public RootElement() {}public T add(IBlockElement element) {public T add(Image image) {public FontProvider getFontProvider() {public void setFontProvider(FontProvider fontProvider) {public void setProperty(int property, Object value) {public <T1> T1 getProperty(int property) {public boolean hasProperty(int property) {public boolean hasOwnProperty(int property) {public <T1> T1 getOwnProperty(int property) {public void deleteOwnProperty(int property) {public <T1> T1 getDefaultProperty(int property) {public RootRenderer getRenderer() {public T showTextAligned(String text, float x, float y, TextAlignment textAlign) {public T showTextAligned(String text, float x, float y, TextAlignment textAlign, float angle) {public T showTextAligned(String text, float x, float y, TextAlignment textAlign, VerticalAlignment vertAlign, float angle) {public T showTextAligned(Paragraph p, float x, float y, TextAlignment textAlign) {public T showTextAligned(Paragraph p, float x, float y, TextAlignment textAlign, VerticalAlignment vertAlign) {public T showTextAligned(Paragraph p, float x, float y, int pageNumber, TextAlignment textAlign, VerticalAlignment vertAlign, float radAngle) {public T showTextAlignedKerned(String text, float x, float y, TextAlignment textAlign, VerticalAlignment vertAlign, float radAngle) {protected abstract RootRenderer ensureRootRendererNotNull();protected void createAndAddRendererSubTree(IElement element) {private LayoutTaggingHelper initTaggingHelperIfNeeded() {private T addElement(IElement element) {? ? ? ? ? ? ? ? ? ? ? ? ??
ElementPropertyContainer
public abstract class ElementPropertyContainer<T extends IPropertyContainer> extends AbstractIdentifiableElement implements IPropertyContainer {protected Map<Integer, Object> properties = new HashMap();public ElementPropertyContainer() {}********* propertypublic boolean hasProperty(int property) {public <T1> T1 getProperty(int property) {public void setProperty(int property, Object value) {public boolean hasOwnProperty(int property) {public <T1> T1 getOwnProperty(int property) {public void deleteOwnProperty(int property) {public <T1> T1 getDefaultProperty(int property) {********* positionpublic T setRelativePosition(float left, float top, float right, float bottom) {public T setFixedPosition(float left, float bottom, float width) {public T setFixedPosition(float left, float bottom, UnitValue width) {public T setFixedPosition(int pageNumber, float left, float bottom, float width) {public T setFixedPosition(int pageNumber, float left, float bottom, UnitValue width) {********* fontpublic T setFont(PdfFont font) {public T setFontFamily(String... fontFamilyNames) {public T setFontFamily(List<String> fontFamilyNames) {public T setFontColor(Color fontColor) {public T setFontColor(Color fontColor, float opacity) {public T setFontSize(float fontSize) {public T setFontKerning(FontKerning fontKerning) {public T setFontScript(UnicodeScript script) {public T setBold() { //字體加粗public T setItalic() { //字體傾斜********* backgroundpublic T setBackgroundColor(Color backgroundColor) {public T setBackgroundColor(Color backgroundColor, float opacity) {public T setBackgroundColor(Color backgroundColor, float extraLeft, float extraTop, float extraRight, float extraBottom) {public T setBackgroundColor(Color backgroundColor, float opacity, float extraLeft, float extraTop, float extraRight, float extraBottom) {public T setBackgroundImage(BackgroundImage image) {public T setBackgroundImage(List<BackgroundImage> imagesList) {********* borderpublic T setBorder(Border border) {public T setBorderTop(Border border) {public T setBorderLeft(Border border) {public T setBorderRight(Border border) {public T setBorderBottom(Border border) {public T setBorderRadius(BorderRadius borderRadius) {public T setBorderTopLeftRadius(BorderRadius borderRadius) {public T setBorderTopRightRadius(BorderRadius borderRadius) {public T setBorderBottomRightRadius(BorderRadius borderRadius) {public T setBorderBottomLeftRadius(BorderRadius borderRadius) {public T setStrokeColor(Color strokeColor) {public Color getStrokeColor() { //邊框顏色public T setStrokeWidth(float strokeWidth) {public Float getStrokeWidth() { //邊框寬度 ********* underlinepublic T setUnderline() { //文本加下劃線public T setLineThrough() { //文本加刪除線public T setUnderline(float thickness, float yPosition) {public T setUnderline(Color color, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle) {public T setUnderline(Color color, float opacity, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle) {********* 其余操作public T setHorizontalAlignment(HorizontalAlignment horizontalAlignment) {public T setTextAlignment(TextAlignment alignment) { //文本對齊方式public T setCharacterSpacing(float charSpacing) {public T setWordSpacing(float wordSpacing) { //單詞間距public T setTextRenderingMode(int textRenderingMode) {public Integer getTextRenderingMode() { //文本渲染方式public T setSplitCharacters(ISplitCharacters splitCharacters) {public ISplitCharacters getSplitCharacters() { //文本分隔符public T setBaseDirection(BaseDirection baseDirection) {public T setDestination(String destination) {public T setOpacity(Float opacity) { //文本透明度public T setHyphenation(HyphenationConfig hyphenationConfig) { //設置連字符? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? ? ? ?
AreaBreak:區域間隔符
public class AreaBreak extends AbstractElement<AreaBreak> {protected PageSize pageSize;public AreaBreak() {public AreaBreak(AreaBreakType areaBreakType) {public AreaBreak(PageSize pageSize) {public PageSize getPageSize() {public void setPageSize(PageSize pageSize) {public AreaBreakType getType() {return (AreaBreakType)this.getProperty(2);}protected IRenderer makeNewRenderer() {? ? ? ? ? ? ? ? ? ? ?
AreaBreakType
public enum AreaBreakType {NEXT_AREA, //下一個區域NEXT_PAGE, //新建一頁LAST_PAGE; //最后一頁private AreaBreakType() {} }? ? ? ? ? ? ? ? ??
AbstractElement
public abstract class AbstractElement<T extends IElement> extends ElementPropertyContainer<T> implements IAbstractElement {protected IRenderer nextRenderer;protected List<IElement> childElements = new ArrayList();protected Set<Style> styles;public AbstractElement() {}public IRenderer createRendererSubTree() {public void setNextRenderer(IRenderer renderer) {public IRenderer getRenderer() {public T addStyle(Style style) {public T setAction(PdfAction action) {public T setPageNumber(int pageNumber) {public boolean isEmpty() {public List<IElement> getChildren() {public boolean hasProperty(int property) {public <T1> T1 getProperty(int property) {protected abstract IRenderer makeNewRenderer(); }? ? ? ? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ??
IBlockElement:接口實現類如下
public interface IBlockElement extends IAbstractElement { }? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? ??
?BlockElement
public abstract class BlockElement<T extends IElement> extends AbstractElement<T> implements IAccessibleElement, IBlockElement {protected BlockElement() {}public <T1> T1 getDefaultProperty(int property) {switch(property) {case 103:case 104:return OverflowPropertyValue.FIT;default:return super.getDefaultProperty(property);}}*********** 內邊距public T setPaddingLeft(float value) {public T setPaddingRight(float value) {public T setPaddingTop(float value) {public T setPaddingBottom(float value) {public UnitValue getPaddingLeft() {public UnitValue getPaddingRight() {public UnitValue getPaddingTop() {public UnitValue getPaddingBottom() {public T setPadding(float commonPadding) {public T setPaddings(float paddingTop, float paddingRight, float paddingBottom, float paddingLeft) {*********** 頁邊距public T setMarginLeft(float value) {public T setMarginRight(float value) {public T setMarginTop(float value) {public T setMarginBottom(float value) {public UnitValue getMarginLeft() {public UnitValue getMarginRight() {public UnitValue getMarginTop() {public UnitValue getMarginBottom() {public T setMargin(float commonMargin) {public T setMargins(float marginTop, float marginRight, float marginBottom, float marginLeft) {*********** 寬度、高度public T setWidth(float width) {public T setWidth(UnitValue width) {public UnitValue getWidth() {public T setHeight(UnitValue height) {public T setHeight(float height) {public UnitValue getHeight() {public T setMaxHeight(float maxHeight) {public T setMaxHeight(UnitValue maxHeight) {public T setMinHeight(UnitValue minHeight) {public T setMinHeight(float minHeight) {public T setMaxWidth(UnitValue maxWidth) {public T setMaxWidth(float maxWidth) {public T setMinWidth(UnitValue minWidth) {public T setMinWidth(float minWidth) {*********** 其余操作public T setVerticalAlignment(VerticalAlignment verticalAlignment) {public T setSpacingRatio(float ratio) {public Boolean isKeepTogether() {public T setKeepTogether(boolean keepTogether) {public Boolean isKeepWithNext() {public T setKeepWithNext(boolean keepWithNext) {public T setRotationAngle(float angleInRadians) {public T setRotationAngle(double angleInRadians) {? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Cell:單元格
public class Cell extends BlockElement<Cell> {private static final Border DEFAULT_BORDER = new SolidBorder(0.5F);private int row;private int col;private int rowspan;private int colspan;protected DefaultAccessibilityProperties tagProperties;********** 構造方法public Cell(int rowspan, int colspan) {public Cell() {********** 普通方法public int getRow() {public int getCol() {public int getRowspan() {public int getColspan() {public Cell add(IBlockElement element) {public Cell add(Image element) {public IRenderer getRenderer() {public <T1> T1 getDefaultProperty(int property) {public AccessibilityProperties getAccessibilityProperties() {public String toString() {public Cell clone(boolean includeContent) {protected IRenderer makeNewRenderer() {protected Cell updateCellIndexes(int row, int col, int numberOfColumns) {? ? ? ? ? ? ? ? ? ? ? ?
Div
public class Div extends BlockElement<Div> {protected DefaultAccessibilityProperties tagProperties;public Div() {}public Div add(IBlockElement element) {public Div add(Image element) {public Div add(AreaBreak areaBreak) {public AccessibilityProperties getAccessibilityProperties() {public Div setFillAvailableArea(boolean fillArea) {public Div setFillAvailableAreaOnSplit(boolean fillAreaOnSplit) {protected IRenderer makeNewRenderer() {? ? ? ? ? ? ? ? ? ??
FlexContainer:default方法,不可直接使用
class FlexContainer extends Div {public FlexContainer() {}protected IRenderer makeNewRenderer() {return new FlexContainerRenderer(this);} }? ? ? ? ? ? ? ? ? ? ? ? ? ?
LineSeparator:行分隔符
public class LineSeparator extends BlockElement<LineSeparator> {protected DefaultAccessibilityProperties tagProperties;public LineSeparator(ILineDrawer lineDrawer) {this.setProperty(35, lineDrawer);}public AccessibilityProperties getAccessibilityProperties() {if (this.tagProperties == null) {this.tagProperties = new DefaultAccessibilityProperties("Artifact");}return this.tagProperties;}protected IRenderer makeNewRenderer() {return new LineSeparatorRenderer(this);} }? ? ? ? ? ? ? ? ? ? ? ?
List
public class List extends BlockElement<List> {public static final String DEFAULT_LIST_SYMBOL = "- ";protected DefaultAccessibilityProperties tagProperties;public List() {}public List(ListNumberingType listNumberingType) {this.setListSymbol(listNumberingType);}public List add(ListItem listItem) {public List add(String text) {public List setListSymbol(String symbol) {public List setListSymbol(Text text) {public List setListSymbol(Image image) {public List setListSymbol(ListNumberingType listNumberingType) {public List setListSymbolAlignment(ListSymbolAlignment alignment) {public List setItemStartIndex(int start) {public List setSymbolIndent(float symbolIndent) {public void setPreSymbolText(String preSymbolText) {public void setPostSymbolText(String postSymbolText) {public Float getSymbolIndent() {public String getPreSymbolText() {public String getPostSymbolText() {public AccessibilityProperties getAccessibilityProperties() {public <T1> T1 getDefaultProperty(int property) {protected IRenderer makeNewRenderer() {? ? ? ? ? ? ? ? ? ? ? ??
ListItem
public class ListItem extends Div {public ListItem() {public ListItem(String text) {public ListItem(Image image) {public ListItem setListSymbol(String symbol) {public ListItem setListSymbol(Text text) {public ListItem setListSymbol(Image image) {public ListItem setListSymbol(ListNumberingType listNumberingType) {public ListItem setListSymbolOrdinalValue(int ordinalValue) {public <T1> T1 getDefaultProperty(int property) {public AccessibilityProperties getAccessibilityProperties() {protected IRenderer makeNewRenderer() {? ? ? ? ? ? ? ? ? ? ? ? ?
Paragraph
public class Paragraph extends BlockElement<Paragraph> {protected DefaultAccessibilityProperties tagProperties;public Paragraph() {public Paragraph(String text) {public Paragraph(Text text) {public Paragraph add(String text) {public Paragraph add(ILeafElement element) {public Paragraph add(IBlockElement element) {public <T2 extends ILeafElement> Paragraph addAll(List<T2> elements) {public Paragraph addTabStops(TabStop... tabStops) {public Paragraph addTabStops(List<TabStop> tabStops) {public Paragraph removeTabStop(float tabStopPosition) {public Paragraph setFirstLineIndent(float indent) {public Paragraph setOrphansControl(ParagraphOrphansControl orphansControl) {public Paragraph setWidowsControl(ParagraphWidowsControl widowsControl) {public Paragraph setFixedLeading(float leading) {public Paragraph setMultipliedLeading(float leading) {public <T1> T1 getDefaultProperty(int property) {public AccessibilityProperties getAccessibilityProperties() {protected IRenderer makeNewRenderer() {private void addTabStopsAsProperty(List<TabStop> newTabStops) {? ? ? ? ? ? ? ? ? ??
Table
public class Table extends BlockElement<Table> implements ILargeElement {protected DefaultAccessibilityProperties tagProperties;private List<Cell[]> rows;private UnitValue[] columnWidths;private int currentColumn;private int currentRow;private Table header;private Table footer;private boolean skipFirstHeader;private boolean skipLastFooter;private boolean isComplete;private List<Table.RowRange> lastAddedRowGroups;private int rowWindowStart;private Document document;private Cell[] lastAddedRow;private Div caption;********* 構造方法public Table(int numColumns) {public Table(UnitValue[] columnWidths) {public Table(float[] pointColumnWidths) {public Table(int numColumns, boolean largeTable) {public Table(float[] columnWidths, boolean largeTable) {public Table(UnitValue[] columnWidths, boolean largeTable) {********* headerCellpublic Table addHeaderCell(Image image) {public Table addHeaderCell(String content) {public Table addHeaderCell(Cell headerCell) {public <T extends IElement> Table addHeaderCell(BlockElement<T> blockElement) {public Table getHeader() {public boolean isSkipFirstHeader() {public Table setSkipFirstHeader(boolean skipFirstHeader) {********* cellpublic Table addCell(Cell cell) {public Table addCell(Image image) {public Table addCell(String content) {public <T extends IElement> Table addCell(BlockElement<T> blockElement) {public Cell getCell(int row, int column) {********* footerCellpublic Table addFooterCell(Cell footerCell) {public Table addFooterCell(Image image) {public Table addFooterCell(String content) {public <T extends IElement> Table addFooterCell(BlockElement<T> blockElement) {public Table getFooter() {public boolean isSkipLastFooter() {public Table setSkipLastFooter(boolean skipLastFooter) {********* 其余操作public Table setCaption(Div caption) {public Table setCaption(Div caption, CaptionSide side) {public Div getCaption() {public IRenderer createRendererSubTree() {public IRenderer getRenderer() {public void complete() {public boolean isComplete() {public void flush() {public void flushContent() {public void setDocument(Document document) {public Table setExtendBottomRow(boolean isExtended) {public Table setExtendBottomRowOnSplit(boolean isExtended) {public Table setBorderCollapse(BorderCollapsePropertyValue collapsePropertyValue) {public Table setHorizontalBorderSpacing(float spacing) {public Table setVerticalBorderSpacing(float spacing) {public List<Border> getLastRowBottomBorder() {public AccessibilityProperties getAccessibilityProperties() {public Table startNewRow() {public Table setFixedLayout() {public Table setAutoLayout() {public Table useAllAvailableWidth() {public UnitValue getColumnWidth(int column) {public int getNumberOfColumns() {public int getNumberOfRows() {protected IRenderer makeNewRenderer() {protected List<Table.RowRange> getRowGroups() {private void initializeRows() {this.rows = new ArrayList();this.currentColumn = -1;}private void ensureHeaderIsInitialized() {private void ensureFooterIsInitialized() {private void ensureCaptionPropertiesAreSet() {private void initializeLargeTable(boolean largeTable) {private static UnitValue[] normalizeColumnWidths(int numberOfColumns) {private static UnitValue[] normalizeColumnWidths(float[] pointColumnWidths) {private static UnitValue[] normalizeColumnWidths(UnitValue[] unitColumnWidths) {private boolean cellBelongsToAnyRowGroup(Cell cell, List<Table.RowRange> rowGroups) {********** 內部類:RowRangepublic static class RowRange {int startRow;int finishRow;public RowRange(int startRow, int finishRow) {public int getStartRow() {public int getFinishRow() {? ? ? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
總結
以上是生活随笔為你收集整理的itextpdf 简介的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Matlab】线性二次型最优控制问题(
- 下一篇: 818释放规模效能,苏宁易购全场景智慧零