public class Document extends Object implements DocumentComponent
Copyright (c) 2020 xsx All Rights Reserved. x-easypdf-fop is licensed under the 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.
Constructor and Description |
---|
Document() |
Modifier and Type | Method and Description |
---|---|
Document |
addBookmark(BookmarkComponent... bookmarks)
添加书签组件
|
Document |
addBookmark(List<BookmarkComponent> bookmarks)
添加书签组件
|
Document |
addPage(PageComponent... pages)
添加页面组件
|
String |
getContent()
获取xsl-fo文档内容
|
Document |
getDocument()
获取xsl-fo文档
|
Integer |
getTotalPage()
获取总页数
|
void |
save(OutputStream outputStream)
保存模板
|
void |
save(String path)
保存模板
|
Document |
setAuthor(String author)
设置作者
|
Document |
setConfigPath(String configPath)
设置配置文件路径(fop配置文件路径)
|
Document |
setCreationDate(Date date)
设置创建时间
|
Document |
setCreator(String creator)
设置创建者
|
Document |
setKeywords(String keywords)
设置关键词
|
Document |
setSubject(String subject)
设置主题
|
Document |
setTitle(String title)
设置标题
|
Document |
transform()
转换
|
void |
transform(OutputStream outputStream)
转换
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
transform
public Document setConfigPath(String configPath)
注:此路径为绝对路径
configPath
- 配置文件路径(绝对路径)public Document setSubject(String subject)
subject
- 主题public Document setKeywords(String keywords)
keywords
- 关键词public Document setCreator(String creator)
creator
- 创建者public Document setCreationDate(Date date)
date
- 创建时间public Document addPage(PageComponent... pages)
注:不推荐添加多个页面,会影响总页码的准确性
pages
- 页面组件列表public Document addBookmark(BookmarkComponent... bookmarks)
bookmarks
- 书签组件列表public Document addBookmark(List<BookmarkComponent> bookmarks)
bookmarks
- 书签组件列表public void save(String path)
path
- 保存路径public void save(OutputStream outputStream)
outputStream
- 输出流public Document transform()
public void transform(OutputStream outputStream)
transform
in interface DocumentComponent
outputStream
- 输出流public Document getDocument()
getDocument
in interface DocumentComponent
public String getContent()
public Integer getTotalPage()
Copyright © 2024. All rights reserved.