Table of Contents

Method Apply

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

Apply(Attachment, IReadOnlyList<PageEdit>, CancellationToken)

Applies a sequence of page edits to a PDF document and returns the result as an attachment.

public static Attachment Apply(Attachment source, IReadOnlyList<PageEdit> edits, CancellationToken cancellationToken = default)

Parameters

source Attachment

The source PDF attachment.

edits IReadOnlyList<PageEdit>

Ordered list of page edits. Each edit specifies a zero-based source page index and the rotation to apply.

cancellationToken CancellationToken

Cancels the operation.

Returns

Attachment

A new Attachment containing the edited PDF.

Examples

using LMKit.Data;
using LMKit.Document.Pdf;

var src = new Attachment("contract.pdf");
var edits = new[]
{
    new PageEdit(2, PageOrientations.Normal),       // keep page 3 as-is
    new PageEdit(0, PageOrientations.Rotated90CW),  // page 1 rotated 90 CW
};
Attachment edited = PdfEditor.Apply(src, edits);
Share