Hey,
I’m evaluating your PDF SDK and I really love it so far.
I have the need to concatenate a lot of PDF files (can be more than 500 up to several thousands).
I’m using the following code:
// create PdfFileEditor object
PdfFileEditor pdfMerger = new PdfFileEditor();
pdfMerger.CloseConcatenatedStreams = true;
pdfMerger.ConcatenationPacketSize = 10;
pdfMerger.UseDiskBuffer = true;
pdfMerger.ConvertTo = PdfFormat.PDF_A_1B;
// concatenate files
pdfMerger.Concatenate(pdfFilePaths, mergedPDFPath);
After concatenation is done, I can’t open the resulting PDF as it’s still locked. I tried to encapsulate it with “using”, but PDFFileEditor doesn’t seem to have the IDisposable interface implemented. So far I only succeed to open the resulting PDF after I close my application. I haven’t found a “Close” or similar method for PdfFileEditor. Setting the object to null doesn’t seem to work either.
Is there a way to get rid of that file lock?
Best regards,
Georg
Hi Georg,
Hi Georg,
Thanks for your interest in Aspose.Pdf. Please note you can not convert PDF to PDFA while merging PDF documents. Please use ConvertTo property can be used set PDF versions(1.3.1.4.1.5,1.6) instead PDFA standards. You may convert merged PDF to PDFA using following documentation link. Hopefully it will resolve the issue.
// Create PdfFileEditor object
PdfFileEditor pdfMerger = new PdfFileEditor
{
CloseConcatenatedStreams = true,
ConcatenationPacketSize = 10,
UseDiskBuffer = true,
ConvertTo = PdfFormat.v_1_5
};
// Additional operations can be performed here
Please feel free to contact us for any further assistance.
Best Regards,