public class Textarea extends AbstractComponent
Copyright (c) 2020 xsx All Rights Reserved. x-easypdf-pdfbox is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.
Modifier and Type | Field and Description |
---|---|
protected CatalogInfo |
catalog
目录
|
protected Color |
deleteLineColor
删除线颜色
|
protected Float |
deleteLineWidth
删除线宽度
|
protected FontConfiguration |
fontConfiguration
字体配置
|
protected Color |
highlightColor
高亮颜色
|
protected List<TextLineInfo> |
infoList
文本行列表
|
protected InnerDest |
innerDest
内部目标
|
protected Boolean |
isDeleteLine
是否删除线
|
protected Boolean |
isHighlight
是否高亮
|
protected Boolean |
isUnderline
是否下划线
|
protected OuterDest |
outerDest
外部目标
|
protected Float |
rise
上升值
|
protected Integer |
tabSize
制表符大小
|
protected String |
text
文本内容
|
protected AbstractTextHandler |
textHandler
文本助手
|
protected List<String> |
textList
文本列表
|
protected Color |
underlineColor
下划线颜色
|
protected Float |
underlineWidth
下划线宽度
|
beginX, beginY, borderConfiguration, horizontalAlignment, isBreak, isCustomPosition, isWrap, marginConfiguration, pagingCondition, pagingEvents, relativeBeginX, relativeBeginY, verticalAlignment
contentMode, context, isResetContentStream, log
Modifier and Type | Method and Description |
---|---|
protected void |
addBorder(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle,
org.apache.pdfbox.pdmodel.PDPageContentStream stream)
添加边框
|
protected void |
addDeleteLine(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle,
org.apache.pdfbox.pdmodel.PDPageContentStream stream)
添加删除线
|
protected void |
addHighlight(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle,
org.apache.pdfbox.pdmodel.PDPageContentStream contentStream)
添加高亮(不支持旋转)
|
protected void |
addInnerDest(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle)
添加内部目标
|
protected void |
addLink(org.apache.pdfbox.pdmodel.interactive.action.PDAction action,
String name,
org.apache.pdfbox.pdmodel.common.PDRectangle rectangle,
HighlightMode mode)
添加链接
|
protected void |
addOuterDest(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle)
添加外部目标
|
protected void |
addText(TextLineInfo text,
org.apache.pdfbox.pdmodel.common.PDRectangle rectangle,
org.apache.pdfbox.pdmodel.PDPageContentStream contentStream)
添加文本
|
protected void |
addUnderline(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle,
org.apache.pdfbox.pdmodel.PDPageContentStream stream)
添加下划线
|
protected org.apache.pdfbox.pdmodel.PDPageContentStream |
checkPaging(org.apache.pdfbox.pdmodel.PDPageContentStream contentStream,
Position position)
检查分页
|
Float |
getCharacterSpacing()
获取字符间距
|
protected org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary |
getDefaultLinkBorderStyle()
获取默认链接边框样式
|
PDFont |
getFont()
获取字体
|
Float |
getFontAlpha()
获取字体透明度
|
Color |
getFontColor()
获取字体颜色
|
String |
getFontName()
获取字体名称
|
Float |
getFontSize()
获取字体大小
|
Float |
getFontSlope()
获取字体斜率(斜体字)
|
FontStyle |
getFontStyle()
获取字体样式
|
Float |
getLeading()
获取行间距
|
protected org.apache.pdfbox.pdmodel.common.PDRectangle |
getLineRectangle(float textWidth,
Position position)
获取行尺寸
|
protected float |
getMinWidth()
获取最小宽度
|
String |
getPlaceholder()
获取页码占位符
|
List<String> |
getSpecialFontNames()
获取特殊字体名称
|
Color |
getStrokColor()
获取字体描边颜色
|
ComponentType |
getType()
获取类型
|
protected void |
init()
初始化
|
protected void |
initAfterPagingPosition(Position position)
初始化分页后坐标
|
protected void |
initCatalog(Position position)
初始化目录
|
protected org.apache.pdfbox.pdmodel.PDPageContentStream |
initContentStream()
初始化内容流
|
protected void |
initMatrix(org.apache.pdfbox.pdmodel.PDPageContentStream stream,
float beginX,
float beginY)
初始化矩阵
|
protected void |
initText()
初始化文本
|
protected void |
initTextList(List<String> tempTextList)
初始化文本列表
|
protected List<String> |
processText(String text)
处理文本
|
protected void |
reset()
重置
|
protected void |
resetPagePosition(Position position,
float textWidth)
重置位置坐标
|
void |
setCharacterSpacing(float spacing)
设置字符间距
|
void |
setDeleteLineWidth(float width)
设置删除线宽度
|
void |
setFontAlpha(float alpha)
设置字体透明度
|
void |
setFontColor(Color color)
设置字体颜色
|
void |
setFontName(String fontName)
设置字体名称
|
void |
setFontSize(float size)
设置字体大小
|
void |
setFontSlope(float slope)
设置字体斜率(斜体字)
|
void |
setFontStyle(FontStyle style)
设置字体样式
|
void |
setLeading(float leading)
设置行间距
|
void |
setSpecialFontNames(String... fontNames)
设置特殊字体名称
|
void |
setStrokColor(Color color)
设置字体描边颜色
|
void |
setTabSize(int size)
设置制表符大小(空格数)
|
void |
setTextHandler(AbstractTextHandler handler)
设置文本助手
|
void |
setUnderlineWidth(float width)
设置下划线宽度
|
protected void |
virtualCheckPaging(Position position)
检查分页
|
protected void |
virtualWrite()
虚拟渲染
|
protected void |
virtualWrite(TextLineInfo text,
Position position)
虚拟写入
|
protected void |
write()
渲染
|
protected org.apache.pdfbox.pdmodel.PDPageContentStream |
write(TextLineInfo text,
org.apache.pdfbox.pdmodel.PDPageContentStream contentStream,
Position position)
写入
|
protected void |
writeContents()
写入内容
|
addPagingEvent, checkPaging, checkPaging, checkPaging, checkWrap, close, executeBreak, getBase, getBorderBottomColor, getBorderDottedSpacing, getBorderLeftColor, getBorderLineCapStyle, getBorderLineLength, getBorderLineStyle, getBorderLineWidth, getBorderRightColor, getBorderTopColor, getBottom, getIsBorderBottom, getIsBorderLeft, getIsBorderRight, getIsBorderTop, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getPage, initBeginX, initBeginXY, initBeginY, initBeginYForPaging, isNeedWrap, isPaging, isPagingComponent, isWrap, processBreak, render, reset, resetXY, setBeginX, setBeginX, setBeginY, setBeginY, setBorderBottomColor, setBorderColor, setBorderDottedSpacing, setBorderLeftColor, setBorderLineCapStyle, setBorderLineLength, setBorderLineStyle, setBorderLineWidth, setBorderRightColor, setBorderRightColor, setBorderTopColor, setIsBorder, setIsBorderBottom, setIsBorderLeft, setIsBorderRight, setIsBorderTop, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, virtualRender, wrap
init, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext, getPagingCondition, getPagingEvents, setHorizontalAlignment, setVerticalAlignment
protected FontConfiguration fontConfiguration
protected CatalogInfo catalog
protected AbstractTextHandler textHandler
protected Integer tabSize
protected String text
protected List<TextLineInfo> infoList
protected Float rise
protected Color highlightColor
protected Boolean isHighlight
protected Float underlineWidth
protected Color underlineColor
protected Boolean isUnderline
protected Float deleteLineWidth
protected Color deleteLineColor
protected Boolean isDeleteLine
protected InnerDest innerDest
protected OuterDest outerDest
public Textarea(Page page)
page
- 页面public void setTextHandler(AbstractTextHandler handler)
handler
- 助手public void setTabSize(int size)
size
- 大小public void setUnderlineWidth(float width)
width
- 宽度public void setDeleteLineWidth(float width)
width
- 宽度public ComponentType getType()
public String getPlaceholder()
public PDFont getFont()
public String getFontName()
public void setFontName(String fontName)
fontName
- 字体名称public void setSpecialFontNames(String... fontNames)
fontNames
- 字体名称public Float getFontSize()
public void setFontSize(float size)
size
- 大小public Color getFontColor()
public void setFontColor(Color color)
color
- 颜色public Color getStrokColor()
public void setStrokColor(Color color)
color
- 颜色public Float getFontAlpha()
public void setFontAlpha(float alpha)
alpha
- 透明度public FontStyle getFontStyle()
public void setFontStyle(FontStyle style)
style
- 样式public Float getFontSlope()
public void setFontSlope(float slope)
slope
- 斜率public Float getCharacterSpacing()
public void setCharacterSpacing(float spacing)
spacing
- 间距public Float getLeading()
public void setLeading(float leading)
leading
- 行间距protected void init()
init
in class AbstractComponent
protected void writeContents()
writeContents
in class AbstractComponent
protected void reset()
reset
in class AbstractComponent
protected void initText()
protected List<String> processText(String text)
text
- 文本protected void initTextList(List<String> tempTextList)
tempTextList
- 临时文本列表protected void initCatalog(Position position)
position
- 坐标protected float getMinWidth()
getMinWidth
in class AbstractComponent
protected void virtualWrite()
protected void write()
protected void virtualWrite(TextLineInfo text, Position position)
text
- 文本position
- 坐标protected org.apache.pdfbox.pdmodel.PDPageContentStream write(TextLineInfo text, org.apache.pdfbox.pdmodel.PDPageContentStream contentStream, Position position)
text
- 文本contentStream
- 内容流position
- 坐标protected org.apache.pdfbox.pdmodel.PDPageContentStream checkPaging(org.apache.pdfbox.pdmodel.PDPageContentStream contentStream, Position position)
contentStream
- 内容流position
- 坐标protected void virtualCheckPaging(Position position)
position
- 坐标protected void initAfterPagingPosition(Position position)
position
- 坐标protected void addHighlight(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle, org.apache.pdfbox.pdmodel.PDPageContentStream contentStream)
rectangle
- 尺寸contentStream
- 内容流protected void addText(TextLineInfo text, org.apache.pdfbox.pdmodel.common.PDRectangle rectangle, org.apache.pdfbox.pdmodel.PDPageContentStream contentStream)
text
- 文本rectangle
- 尺寸contentStream
- 内容流protected void addDeleteLine(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle, org.apache.pdfbox.pdmodel.PDPageContentStream stream)
rectangle
- 尺寸stream
- 内容流protected void addUnderline(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle, org.apache.pdfbox.pdmodel.PDPageContentStream stream)
rectangle
- 尺寸stream
- 内容流protected void addInnerDest(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle)
rectangle
- 尺寸protected void addOuterDest(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle)
rectangle
- 尺寸protected void addLink(org.apache.pdfbox.pdmodel.interactive.action.PDAction action, String name, org.apache.pdfbox.pdmodel.common.PDRectangle rectangle, HighlightMode mode)
action
- 动作name
- 名称rectangle
- 尺寸protected void addBorder(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle, org.apache.pdfbox.pdmodel.PDPageContentStream stream)
rectangle
- 尺寸stream
- 内容流protected org.apache.pdfbox.pdmodel.PDPageContentStream initContentStream()
protected void initMatrix(org.apache.pdfbox.pdmodel.PDPageContentStream stream, float beginX, float beginY)
stream
- pdfbox内容流beginX
- 起始X轴坐标beginY
- 起始Y轴坐标protected org.apache.pdfbox.pdmodel.common.PDRectangle getLineRectangle(float textWidth, Position position)
textWidth
- 文本宽度position
- 坐标protected org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary getDefaultLinkBorderStyle()
protected void resetPagePosition(Position position, float textWidth)
position
- 坐标textWidth
- 文本宽度Copyright © 2024. All rights reserved.