public void MergePDFFiles(string[] filepaths, string outputpath)
{
using (FileStream stream = new FileStream(outputpath, FileMode.Create))
{
Document document = new Document();
PdfCopy pdf = new PdfCopy(document, stream);
document.Open();
foreach (string filepath in filepaths)
{
using (PdfReader reader = new PdfReader(filepath))
{
pdf.AddDocument(reader);
}
}
document.Close();
}
}
Aucun commentaire:
Enregistrer un commentaire