public abstract class AbstractTextHandler extends AbstractExpander
Copyright (c) 2020-2024 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.
document, log| 构造器和说明 |
|---|
AbstractTextHandler(Document document)
有参构造
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected Context |
getContext()
获取上下文
|
float |
getTextHeight(FontConfiguration fontConfiguration,
int rowCount)
获取文本高度
|
float |
getTextWidth(FontConfiguration fontConfiguration,
String text)
获取文本宽度
|
List<String> |
splitLines(FontConfiguration fontConfiguration,
String text,
float lineWidth)
拆分文本段落(换行)
|
String |
splitText(FontConfiguration fontConfiguration,
String text,
float lineWidth)
拆分文本(单行)
|
abstract void |
writeText(FontConfiguration fontConfiguration,
org.apache.pdfbox.pdmodel.PDPageContentStream contentStream,
String text)
写入文本
|
getDocumentpublic AbstractTextHandler(Document document)
document - 文档public abstract void writeText(FontConfiguration fontConfiguration, org.apache.pdfbox.pdmodel.PDPageContentStream contentStream, String text)
fontConfiguration - 字体配置contentStream - 内容流text - 文本public String splitText(FontConfiguration fontConfiguration, String text, float lineWidth)
fontConfiguration - 字体配置text - 文本lineWidth - 行宽public List<String> splitLines(FontConfiguration fontConfiguration, String text, float lineWidth)
fontConfiguration - 字体配置text - 文本lineWidth - 行宽public float getTextWidth(FontConfiguration fontConfiguration, String text)
fontConfiguration - 字体配置text - 文本public float getTextHeight(FontConfiguration fontConfiguration, int rowCount)
fontConfiguration - 字体配置rowCount - 行数protected Context getContext()
Copyright © 2024. All rights reserved.