Attached is the sample Visual Studio 2010 project (not
including the Aspose dll due to file size). It is set to combine the 12
documents in the SourceDocuments folder into batches of 2, resulting in 6
combined PDFs. I have left the output from a previous run in
the Output folder. On these smaller batches, it seems to either work or
output 0 bytes. On larger batches (100, 500) of larger source PDFs, it is
more common to see truncated result files.
Since it’s a threading issue, it doesn’t happen every single
time, but on this small sample set it’s happening about 4 out of 5 times for
Adjust the sourceFolder variable in the code to point to the
directory with sample documents. Documents are expected to be numbered
1.pdf, 2.pdf, etc.
Also adjust the outFolder variable to specify where the
Combined_n.pdf files will be output.