Different time to save between Aspose.PDF versions

Hello,
When using the code snippet below Save the file in the:

  1. aspose.PDF 20.1 takes around 6736 ms
  2. aspose.PDF 24.6 takes around 150612 ms

Can anything be done to reduce the time in the latest version?

Here’s the test document input.pdf (953.4 KB)

and here’s a simple project that demonstrates the issue
Aspose PDF Test.zip (487.2 KB)
PS: you must add the Aspose.PDF Jar (20.1 or 24.6) to see the issue.

Thank you for your support

Example Code
import com.aspose.pdf.Document;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class Main {
    public static void main(String[] args) {
        // File paths
        String inputFilePath = "src/input.pdf";
        String outputFilePath = "src/output.pdf";

        try {
            // Read the file
            File inputFile = new File(inputFilePath);
            FileInputStream fileInputStream = new FileInputStream(inputFile);

            // Load the document using Aspose
            Document doc = new Document(fileInputStream);

            // Save the document to a new file
            System.out.println("Start save process...");
            long startTime = System.currentTimeMillis();
            FileOutputStream fileOutputStream = new FileOutputStream(outputFilePath);
            doc.save(fileOutputStream);
            long endTime = System.currentTimeMillis();
            System.out.println("Saving process took " + (endTime - startTime) + " ms");
            System.out.println("Document saved successfully...");
            // Close the streams
            fileInputStream.close();
            fileOutputStream.close();
            System.out.println("End Process...");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

@ftf

Can you please share your environment details like OS Name and Version, Installed RAM size, JDK Version, etc.? We will log an investigation ticket and share the ID with you.

Sure,

Here’s the details :

  1. OS Name - Version: Windows 10
  2. RAM: 16 GB
  3. JDK Version: jdk1.8.0_191 (also tested with jdk-11.0.13)
  4. CPU: Intel i5 8th Generation
  5. Disk: 1TB SSD

Let me know if you need any additional information.
Thank you :smiley:

@ftf
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): PDFJAVA-44121

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.