Hi,
we are currently trying to convert a simple PDF to PDF/A with Aspose.PDF.
Sadly we are not successful, because of OutOfMemory-Issues.
Code:
OptimizedMemoryStream ms = new OptimizedMemoryStream(Files.readAllBytes(pdfFile.toPath()));
try (com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(ms);
// just write the first Bytes of the protocol
FixedSizeByteArrayOutputStream logStream = new FixedSizeByteArrayOutputStream(ASPOSE_LOG_MAX_LENGTH)) {
// ⚡ OOM
boolean convertResult = pdfDocument.convert(logStream, PdfFormat.PDF_A_1B, ConvertErrorAction.Delete, ConvertTransparencyAction.Default);
if (convertResult) {
pdfDocument.save(convertedPdf.getAbsolutePath());
}
} finally {
ms.close();
}
Attached you find our PDF-File.
Profiling this method leads to memory-usage von ~8GB. Do you have any tips to reduce the amount of RAM?
For our customers we need to aim to PDF files with ~200MB in size.
20Seiten_PDF_A1.pdf (5,1 MB)