Why are white pages displayed

详情页.pdf (9.4 MB)

public static void main(String[] args) throws FileNotFoundException {
String inputFileName = Paths.get(“详情页.pdf”).toString();
Document pdfDocument = new Document(inputFileName);
List list = new ArrayList<>(pdfDocument.getPages().size());
try {
for (int pageCount = 1; pageCount <= pdfDocument.getPages().size(); pageCount++) {
// Create stream object to save the output image
String outputFilePath = “aa.jpg”;

            final Instant now = Instant.now();
            java.io.OutputStream imageStream = new java.io.FileOutputStream(outputFilePath);

            JpegDevice JpegDevice = new JpegDevice(50);

            JpegDevice.process(pdfDocument.getPages().get_Item(pageCount), imageStream);
            imageStream.close();
        }
    } finally {
        if (pdfDocument != null) {
            pdfDocument.dispose();
        }
    }
    
}

@zyx

We have been able to reproduce the issue in our environment while testing the scenario with Aspose.PDF for Java 21.6. Therefore, a ticket as PDFJAVA-40671 has been logged in our issue tracking system to investigate this issue. We will further look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFJAVA-40671) have been fixed in Aspose.PDF for Java 22.7.