how to merge pdf file [iTextSharp]

Make 3 instance
how to merge pdf file [iTextSharp]   MemoryStream stream  =   new  MemoryStream();
how to merge pdf file [iTextSharp]            Document doc 
=   new  Document();
how to merge pdf file [iTextSharp]            PdfCopy writer 
=   new  PdfCopy(doc, stream);
how to merge pdf file [iTextSharp]            doc.Open();
how to merge pdf file [iTextSharp]

Read what page you need.
add these page to writer.
index is start at 1

how to merge pdf file [iTextSharp] string  path2  = " how to merge pdf file [iTextSharp]. " ;   
how to merge pdf file [iTextSharp]PdfReader pf 
=   new  PdfReader(path2);
how to merge pdf file [iTextSharp]
how to merge pdf file [iTextSharp]                page 
=   writer.GetImportedPage(pf,  1 );
how to merge pdf file [iTextSharp]                writer.AddPage(page);

close
how to merge pdf file [iTextSharp]    pf.Close();   
how to merge pdf file [iTextSharp]doc.Close();
how to merge pdf file [iTextSharp]            
return  stream;

你可能感兴趣的:(itext)