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

274 views Asked by At
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. Can you propose an approach for this?
I am trying to find a solution using odftoolkit. Read the documentation but did not find any helper method that gives a specific page of .odt document.

1

There are 1 answers

0
Raboro On

The problem is that in OdfToolkit .odt implementation there is only one page. Sure the page count could be 10 or whatever the "real" page counter may look like in your program e.g. LibreOffice. But OdfToolkit sees all text as one page. That means you can get the number of pages but you need to access the text of all pages not over there pages.