Class DocumentToMarkdownPageStartingEventArgs
- Namespace
- LMKit.Document.Conversion
- Assembly
- LM-Kit.NET.dll
Provides data for the PageStarting event.
public sealed class DocumentToMarkdownPageStartingEventArgs : EventArgs
- Inheritance
-
DocumentToMarkdownPageStartingEventArgs
- Inherited Members
Examples
Abort when only a preview is needed.
using LMKit.Document.Conversion;
var converter = new DocumentToMarkdown();
converter.PageStarting += (_, e) =>
{
Console.WriteLine($"▶ Page {e.PageNumber}/{e.PageCount} planned: {e.PlannedStrategy}");
if (e.PageNumber > 3) e.Cancel = true; // stop after the first three pages
};
Remarks
Subscribers can inspect the zero-based PageIndex, the total
PageCount, the SourceName, and the strategy that is
about to be applied. Setting Cancel to true aborts the
conversion before the page is processed.
Properties
- Cancel
Gets or sets a value indicating whether the conversion should be canceled before the page is processed.
- PageCount
Gets the total number of pages scheduled for the current conversion.
- PageIndex
Gets the zero-based index of the page that is about to be processed.
- PageNumber
Gets the 1-based page number, convenient for user-facing output.
- PlannedStrategy
Gets the strategy that is about to be applied to this page.
- SourceName
Gets the logical name of the source document, when available.