转换word文档的时候,1页的文档使用,wordDocument.getPageCount()返回2页

使用aspose.words for java V24.3试用版,转换word文档的时候,1页的文档使用,wordDocument.getPageCount()返回2页,请问是什么原因,该怎么解决?

/**
 * word文件获取页码和横板竖版
 * @param
 * @return
 */
public static Map<String,Object> getFileDetail(String filePath){
    Document wordDocument = null;
    InputStream inputStream = null;
    try {
        inputStream = new FileInputStream(filePath);
        wordDocument = new Document(inputStream);
        // 获取第一页的页面大小
        PageSetup pageSetup = wordDocument.getFirstSection().getPageSetup();
        double pageWidth = pageSetup.getPageWidth();
        double pageHeight = pageSetup.getPageHeight();
        Map<String,Object> map = new HashMap<>();
        map.put("total",wordDocument.getPageCount());
        if (pageWidth > pageHeight) {
            map.put("iv","0");
        } else {
            map.put("iv","1");
        }
        return map;
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }finally {
        // 在finally块中将Document对象设置为null释放资源
        wordDocument = null;
        if (inputStream != null) {
            try {
                inputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

1852165521999527936.docx (35.5 KB)

@SalesDhorde
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27547

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.