Search code examples
javaapache-poidocxdocread-data

How to get .adoc pages size with Java


I had a task to read page size of documents like: .doc, .docx, pdf, xls and now i need to count a page size of .adoc document. I googled a lot but didn't find anything familiar for this problem. For .doc, .docx im using Apache POI Java libraries.

So does anyone knows what about .adoc files? Is it even possible to get page size ?


Solution

  • I don't think it is possible on the adoc file itself because that is only defining the textual formatting of the text. A 'compiler' will transform it either in a PDF or HTML artifact, (possibly also other formats).

    So what you could do.. is transforming the adoc file to a pfd and count the number of pages within the generated document.