I want to concatenate multiple PDF files into one single PDF. I found there are two ways i can do that using ASPOSE.PDF for Net
The number of files im trying to merge are between 10 to 100. I want to know which is the best way in terms of Performance and Memory Optimization.
//First Approach
PdfFileEditor pdfEditor = new PdfFileEditor();
return pdfEditor.Concatenate(input, outputStream);
<SPAN style="COLOR: green">//Second Approach</SPAN>
Aspose.Pdf.<SPAN style="COLOR: #2b91af">Document</SPAN> mainDoc = <SPAN style="COLOR: blue">new</SPAN> Aspose.Pdf.<SPAN style="COLOR: #2b91af">Document</SPAN>();
<SPAN style="COLOR: blue">foreach</SPAN> (<SPAN style="COLOR: #2b91af">Stream</SPAN> st <SPAN style="COLOR: blue">in</SPAN> inputStreams)
{
Aspose.Pdf.<SPAN style="COLOR: #2b91af">Document</SPAN> insideDoc = <SPAN style="COLOR: blue">new</SPAN> Aspose.Pdf.<SPAN style="COLOR: #2b91af">Document</SPAN>(st);
mainDoc.Pages.Add(insideDoc.Pages);
}</PRE><PRE style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 13px"> </PRE><PRE style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 13px"> </PRE><PRE style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 13px">Also,as mentioned in the technical artical below on this website where is the FileProcessingStrategy in Aspose.PDf, </PRE><PRE style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 13px">i think it was available only in Pdf kit. </PRE><PRE style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 13px"><A href="http://www.aspose.com/documentation/.net-components/aspose.pdf.kit-for-.net/concatenate-improve-performance-and-optimize-memory-utilization.html">http://www.aspose.com/documentation/.net-components/aspose.pdf.kit-for-.net/concatenate-improve-performance-and-optimize-memory-utilization.html</A> <BR>So how do we optimize the concatination operation in Aspose.PDF</PRE></SPAN></PRE>