Table of Contents

Method MergeToFile

Namespace
LMKit.Document.Pdf
Assembly
LM-Kit.NET.dll

MergeToFile(IEnumerable<Attachment>, string)

Merges multiple PDF attachments into a single output file.

public static void MergeToFile(IEnumerable<Attachment> sources, string outputPath)

Parameters

sources IEnumerable<Attachment>

The source PDF attachments to merge.

outputPath string

Path 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 sources or outputPath is null.

ArgumentException

Thrown when no sources are provided or when any source is not a PDF.