简体   繁体   English

使用 java (odftoolkit) 获取 .odt 文档的特定页面

[英]get specific page of .odt document using java (odftoolkit)

OdfDocument odfDocument = OdfDocument.loadDocument(in);
 
int pages =  odfDocument.getOfficeMetadata().getDocumentStatistic().getPageCount();

I am getting the total pages, but can't find a solution to get specific page of .odt document.我正在获取总页数,但找不到获取.odt文档特定页面的解决方案。 Can you propose an approach for this?你能为此提出一个方法吗?
I am trying to find a solution using odftoolkit .我正在尝试使用odftoolkit找到解决方案。 Read the documentation but did not find any helper method that gives a specific page of .odt document.阅读文档但没有找到任何提供.odt文档特定页面的辅助方法。

The problem is that in OdfToolkit.odt implementation there is only one page.问题是在 OdfToolkit.odt 实现中只有一页。 Sure the page count could be 10 or whatever the "real" page counter may look like in your program eg LibreOffice.当然,页数可以是 10 或任何“真实”页面计数器在您的程序(例如 LibreOffice)中的样子。 But OdfToolkit sees all text as one page.但是 OdfToolkit 将所有文本视为一页。 That means you can get the number of pages but you need to access the text of all pages not over there pages.这意味着您可以获得页数,但您需要访问所有页面的文本,而不是那些页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 jodreports 和 java 在运行时插入 odt 文档 - How to insert on runtime on odt document using jodreports and java 从模板开始,使用JAVA生成ODT文档 - Starting from a template to generate ODT document with JAVA Java odftoolkit,如何将从纯字符串创建的节点添加到odf文档中 - Java odftoolkit, how to add node created from plain string into odf document 使用Java将.doc / .docx文档转换为.odt(打开文档文本),反之亦然。 - Convert .doc/.docx documents to .odt (Open document text) and vice versa using java. 使用Java将docx / ODT转换为图像 - Converting docx/ODT to image using Java 使用freemarker加载odt文件(文档模板)。 如何生成odt文件到PDF格式 - loading odt file (document template) using freemarker. how to generate odt file to pdf ODFDom设置.odt文本文档的页面大小,页面方向和页面边距 - ODFDom set Page Size, Page Orientation, and Page Margins of .odt Text document 如何使用OdfToolkit打印OpenDocument文本? - How to print OpenDocument Text using OdfToolkit? 使用Openoffice Java API(UNO API)将整个ODT(Openoffice Writer)文档部分复制到其他文档 - Copy a whole ODT (Openoffice Writer) document section to other document with Openoffice Java API (UNO API) 获取odt文档的第一个表 - getting the first table of a odt document
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM