private void CreateMergedPdf(object sender, DoWorkEventArgs e) { using (FileStream StreamMulti=new FileStream(MergeOutputPdfName,FileMode.Create)) { Document DocumentMulti = new Document(); PdfCopy WriterMulti = new PdfCopy(DocumentMulti,StreamMulti); DocumentMulti.Open(); try { foreach (string fileItem in ListBox.Items) { PdfReader ReaderMulti = PdfReader(fileItem); WriterMulti.AddDocument(ReaderMulti); ReaderMulti.Close(); } } catch (Exception Ex) { MessageBox.Show(Ex.Message," Merge Error !",MessageBoxButtons.OK,MessageBoxIcon.Error); } WriterMulti.Close(); DocumentMulti.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)