Hello,
When using the code snippet below Save the file in the:
- aspose.PDF 20.1 takes around 6736 ms
- 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();
}
}
}