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.
| 限定符和类型 | 字段和说明 |
|---|---|
protected CatalogInfo |
catalog
目录
|
protected Color |
deleteLineColor
删除线颜色
|
protected Float |
deleteLineWidth
删除线宽度
|
protected Color |
highlightColor
高亮颜色
|
protected InnerDest |
innerDest
内部目标
|
protected Boolean |
isDeleteLine
是否删除线
|
protected Boolean |
isHighlight
是否高亮
|
protected Boolean |
isUnderline
是否下划线
|
protected OuterDest |
outerDest
外部目标
|
protected Integer |
tabSize
制表符大小
|
protected String |
text
文本内容
|
protected List<String> |
textList
文本列表
|
protected Color |
underlineColor
下划线颜色
|
protected Float |
underlineWidth
下划线宽度
|
| 限定符和类型 | 方法和说明 |
|---|---|
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(String 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.common.PDRectangle |
getLineRectangle(float textWidth,
Position position)
获取行尺寸
|
String |
getPlaceholder()
获取页码占位符
|
ComponentType |
getType()
获取类型
|
protected void |
init()
初始化
|
protected void |
initCatalog(Position position)
初始化目录
|
protected org.apache.pdfbox.pdmodel.PDPageContentStream |
initContentStream()
初始化内容流
|
protected void |
initFontColorAndAlpha(org.apache.pdfbox.pdmodel.PDPageContentStream stream)
初始化字体颜色及透明度
|
protected void |
initPosition(org.apache.pdfbox.pdmodel.PDPageContentStream stream,
float beginX,
float beginY)
初始化位置
|
protected void |
initText()
初始化文本
|
protected void |
initTextList(List<String> tempTextList)
初始化文本列表
|
protected void |
initTextList(List<String> tempTextList,
float firstLineWidth,
float newLineWidth)
初始化文本列表
|
protected List<String> |
processText(String text)
处理文本
|
void |
render()
渲染
|
protected void |
resetPagePosition(Position position,
float textWidth)
重置页面位置坐标
|
void |
setDeleteLineWidth(float width)
设置删除线宽度
|
void |
setFontName(String fontName)
设置字体名称
|
void |
setTabSize(int size)
设置制表符大小(空格数)
|
void |
setUnderlineWidth(float width)
设置下划线宽度
|
void |
virtualRender()
虚拟渲染
|
protected void |
virtualWrite(String text,
Position position)
虚拟写入
|
protected org.apache.pdfbox.pdmodel.PDPageContentStream |
write(String text,
float textWidth,
org.apache.pdfbox.pdmodel.PDPageContentStream contentStream,
Position position)
写入
|
checkPaging, checkWrap, close, executeBreak, getBase, getBottom, getPage, initBase, isPaging, isPagingComponent, isWrap, paging, processBreak, reset, resetWrapWidth, resetXY, setBeginX, setBeginX, setBeginY, setBeginY, wrapinit, initFont, setCharacterSpacing, setFontSize, setLeadinginit, initBorder, setBorderColor, setBorderLineLength, setBorderLineSpacing, setBorderWidth, setIsBorderinit, initMargin, initMargin, initMarginWithParam, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTopinit, setHorizontalAlignment, setVerticalAlignmentclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContext, getPagingCondition, getPagingEventsprotected CatalogInfo catalog
protected Integer tabSize
protected String text
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 setFontName(String fontName)
fontName - 字体名称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 void virtualRender()
public void render()
protected void init()
init 在类中 AbstractComponentprotected void initText()
protected void initTextList(List<String> tempTextList)
tempTextList - 临时文本列表protected void initTextList(List<String> tempTextList, float firstLineWidth, float newLineWidth)
tempTextList - 临时文本列表firstLineWidth - 首行宽度newLineWidth - 新行宽度protected void initCatalog(Position position)
position - 坐标protected void virtualWrite(String text, Position position)
text - 文本position - 坐标protected org.apache.pdfbox.pdmodel.PDPageContentStream write(String text, float textWidth, org.apache.pdfbox.pdmodel.PDPageContentStream contentStream, Position position)
text - 文本textWidth - 文本宽度contentStream - 内容流position - 坐标protected void addHighlight(org.apache.pdfbox.pdmodel.common.PDRectangle rectangle,
org.apache.pdfbox.pdmodel.PDPageContentStream contentStream)
rectangle - 尺寸contentStream - 内容流protected void addText(String 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 initFontColorAndAlpha(org.apache.pdfbox.pdmodel.PDPageContentStream stream)
stream - pdfbox内容流protected void initPosition(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 void resetPagePosition(Position position, float textWidth)
position - 坐标textWidth - 文本宽度Copyright © 2024. All rights reserved.