public class AttachmentProcessor extends AbstractProcessor
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 Map<String,EmbeddedFileInfo> |
fileMap
文件字典
|
document, log
Constructor and Description |
---|
AttachmentProcessor(Document document)
有参构造
|
Modifier and Type | Method and Description |
---|---|
void |
addOrSet(EmbeddedFileInfo... files)
添加或替换文件
|
org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile |
buildEmbeddedFile(byte[] data,
String mimeType)
构建嵌入文件
|
protected org.apache.pdfbox.pdmodel.PDDocumentNameDictionary |
createNameDictionary()
创建名称字典
|
protected PDComplexFileSpecification |
createSpecification(EmbeddedFileInfo info)
创建文件描述
|
protected void |
extractFiles(org.apache.pdfbox.pdmodel.common.PDNameTreeNode<PDComplexFileSpecification> tree)
提取文件
|
void |
flush()
刷新文件
|
protected void |
initFiles()
初始化文件
|
void |
remove(String... names)
移除文件
|
getDocument
protected Map<String,EmbeddedFileInfo> fileMap
public AttachmentProcessor(Document document)
document
- 文档public void addOrSet(EmbeddedFileInfo... files)
files
- 文件public void remove(String... names)
names
- 文件名public org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile buildEmbeddedFile(byte[] data, String mimeType)
data
- 数据mimeType
- 邮件扩展类型public void flush()
protected void initFiles()
protected void extractFiles(org.apache.pdfbox.pdmodel.common.PDNameTreeNode<PDComplexFileSpecification> tree)
tree
- 文件树protected org.apache.pdfbox.pdmodel.PDDocumentNameDictionary createNameDictionary()
protected PDComplexFileSpecification createSpecification(EmbeddedFileInfo info)
info
- 嵌入文件信息Copyright © 2025. All rights reserved.