Dear Sir/Madam,
I am using PdfFileEditor to merge 3 PDFs together with the Append(string inputFile, string[] portFiles, int startPage, int EndPage, string outputFile) method.
Given one set of files, this works satisfactorily. However, on a different set of files it fails by not returning from the call to Append().
Please find my code snippet here:
private static void AppendingMerge(string targetFilename)
{
Log.Info(“Appending merge strategy.”);
var startMerging = DateTime.Now;
Log.Info($"{startMerging:HH:mm:ss.fffff} starting to merge using PdfFileEditor.");
var pdfEditor = new PdfFileEditor();
var pageFiles = new List<string>();
for (var pageNum = 1; pageNum < 3; pageNum++)
{
var appendFilename = $@"C:\Temp\VW-Example\2016_06_01_Factbook_2016_Page{pageNum:000}.pdf";
pageFiles.Add(appendFilename);
}
const string finalPage = @"C:\Temp\VW-Example\2016_06_01_Factbook_2016_Page087.pdf";
pdfEditor.Append(finalPage, pageFiles.ToArray(), 1, int.MaxValue, targetFilename);
var stopMerging = DateTime.Now;
var mergingDuration = stopMerging - startMerging;
Log.Info($"{stopMerging:HH:mm:ss.fffff} merged pages using PdfFileEditor in {mergingDuration.TotalMilliseconds} ms.");
Log.Info("Appending merge strategy end.");
}
The files in question, both the set for which it is working and the set for which it is not have been generated by splitting a large presentation. I can provide the files in question, but have failed to find an way to attach them to this bug report.
Kind Regards
StephanPdfFileEditorFailsToMergeSamples.zip (249.8 KB)