I see this has been dormant for a while. In case you still need an answer - yes you can get the page count from Libre Office via Java.
int nPageCount = com.sun.star.uno.AnyConverter.toInt(
xPropertySet.getPropertyValue("PageCount"));
So you'll need to use the API to load the document, interrogate the page count. If you search for "uno" and "PageCount" you'll find complete code examples (such as OO mail archives which also apply to LibreOffice)