Method MergeToFile
MergeToFile(IEnumerable<Attachment>, string)
Merges multiple PDF attachments into a single output file.
public static void MergeToFile(IEnumerable<Attachment> sources, string outputPath)
Parameters
sourcesIEnumerable<Attachment>The source PDF attachments to merge.
outputPathstringPath where the merged PDF will be written.
Examples
using LMKit.Data;
using LMKit.Document;
var invoiceJan = new Attachment("invoice_jan.pdf");
var invoiceFeb = new Attachment("invoice_feb.pdf");
// Merge attachments into a single file
PdfMerger.MergeToFile(
new[] { invoiceJan, invoiceFeb },
"invoices_q1.pdf");
Exceptions
- ArgumentNullException
Thrown when
sourcesoroutputPathisnull.- ArgumentException
Thrown when no sources are provided or when any source is not a PDF.