Please check the sample below.
FileStream fs = new FileStream("C:\\PDF Transcript\\Test Ascii.pdf", FileMode.Open, FileAccess.Read, FileShare.Read);
byte[] pdfData = new byte[fs.Length];
fs.Read(pdfData, 0, pdfData.Length);
fs.Close();
// In this process, there is an attachment.
PdfDocument pdfDocument = new PdfDocument(pdfData);
// In this process, attachment was disappeared.
MergeDocument mergeDocument = new MergeDocument(pdfDocument, MergeOptions.All);
mergeDocument.Draw("C:\\PDF Transcript\\Test.pdf");
What is the problem?