Lyo.Pdf.Models 1.0.2

dotnet add package Lyo.Pdf.Models --version 1.0.2
                    
NuGet\Install-Package Lyo.Pdf.Models -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lyo.Pdf.Models" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lyo.Pdf.Models" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Lyo.Pdf.Models" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lyo.Pdf.Models --version 1.0.2
                    
#r "nuget: Lyo.Pdf.Models, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lyo.Pdf.Models@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lyo.Pdf.Models&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Lyo.Pdf.Models&version=1.0.2
                    
Install as a Cake Tool

Lyo.Pdf.Models

Interfaces and value types for the Lyo PDF stack. Defines the contracts implemented by Lyo.Pdf so consumers can depend on IPdfService, IPdfReader, IPdfWriter, and ITextExtractor without pulling in PdfPig or PDFsharp directly.

Service contracts

  • IPdfService — façade for loading PDFs (OpenFromFile/Bytes/Stream plus …Async and batch variants), URL loading (OpenFromUrlAsync / OpenFromUrlsAsync — async only), creating empty / opening for edit (CreateEmpty, OpenForEdit / OpenForEditAsync), and merging (MergePdfs, MergePdfsToFile, MergePdfsToStream, MergePdfFiles, MergePdfBytes, all sync + async).
  • IPdfReader (IDisposable, IAsyncDisposable) — open PDF: SourceBytes (immutable buffer for merges / OpenForEdit), Metrics, Text (ITextExtractor), GetInfo(), and GetPageSizePoints(pageNumber1Based). Not thread-safe.
  • IPdfWriter (IDisposable) — PdfSharp-backed editor with PageCount, ImportPagesFrom(IPdfReader) / ImportPagesFrom(ReadOnlySpan<byte>), RemovePage, InsertBlankPage, ReorderPages, ToBytes, Save / SaveAsync, and CopyTo / CopyToAsync. Page indices are zero-based; not thread-safe.
  • ITextExtractor — composition of IPdfDocumentText + IPdfDocumentSections, reachable as IPdfReader.Text.
  • IPdfDocumentText — words / lines (GetWords, GetLines, GetWordsBetween, GetLinesBetween), bounding-box and columnar reads (GetLinesInBoundingBox, GetColumnarTextInBoundingBox, GetColumnarText), key/value extraction (ExtractKeyValuePairs with page, word-list, PdfSection, and section-name overloads, plus InferKeyValuePairsFromFormatting), table extraction (ExtractTable / ExtractDataTable with the same overload shapes plus ParseBytesAsDataTable), and inference helpers (InferTableHeadersFromFormatting). Every method has matching sync and async variants.
  • IPdfDocumentSections — section slicing: GetWordsBetweenSections, GetLinesBetweenSections / GetLinesBetweenSectionsAsync, GetSection / GetSectionAsync. Section navigation is anchored by ordered section labels with optional defaultEndSection, startPage, endPage, and yTolerance.

Value types

  • PdfInfoPageCount, Title, Author, Subject, Creator, Producer, FilePath, Url, CreationDate, ModifiedDate.
  • PdfWord(Text, BoundingBox, Format?) and PdfWordFormat(FontSize?, FontName?, FontBold, FontItalic, FontColor?, FontUnderline).
  • PdfTextLine(Y, Words, Text) — words on the same visual row.
  • PdfBoundingBox(Page, Box) — 1-based page + Lyo.Common.Records.BoundingBox2D in PDF points.
  • PdfColumnarText(Columns) with ToCombinedString(separator).
  • PdfSection(Name, StartPage, EndPage, Lines) with computed Words property.
  • ColumnHeader(Label, IsKey = false) — drives table extraction; IsKey columns anchor a new row, others let unmatched lines append to the previous row.
  • KvColumnResult(ColumnIndex, Values) with KvColumnResult.Merge(...) helper.
  • PdfKeyValueLayoutHorizontal (value to the right of the key) or Vertical (value below the key).
  • PdfInferFormattingFlagsNone, Bold, Semicolon (punctuation-terminated labels), Underline.

Options

  • PdfServiceOptions — knobs registered as a singleton by AddPdfService(...): DefaultYTolerance (5.0), DefaultKeyValueGap (0.0), TableHeaderMergeThreshold (20.0), TableHeaderMatchThreshold (0.75), TableColumnXTolerance (5.0), BoundingBoxOverlapThreshold (0.8), MaxContinuationYGap (10.0), MaxContinuationXDistance (100.0), ValueColumnXTolerance (20.0), KeyValueStackedMaxFirstGap (120.0), MaxPdfSizeBytes (falls back to SuggestedMaxPdfSizeBytes = 25 MiB), EnableMetrics (default false), and configuration SectionName = "PdfServiceOptions". MaxTotalLoadedBytes is [Obsolete]; the shared catalog is gone — each IPdfReader is caller-owned.

Targeting

netstandard2.0;net10.0. References Lyo.Common, Lyo.Exceptions, Lyo.Metrics, Lyo.Result, and Lyo.DataTable.Models.

Dependencies

Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).

  • Lyo.Common — (direct, lyo)
  • Lyo.DataTable.Models — (direct, lyo)
  • Lyo.Metrics — (direct, lyo)
  • Lyo.Result — (direct, lyo)
  • Lyo.Exceptions — (transitive, lyo)
  • Microsoft.Extensions.DependencyInjection.Abstractions 10.0.5 — (transitive, microsoft)
  • Microsoft.Extensions.Logging.Abstractions 10.0.5 — (transitive, microsoft)
  • Microsoft.Extensions.Options.ConfigurationExtensions 10.0.5 — (transitive, microsoft)
  • System.Memory 4.6.3 — (transitive, microsoft, netstandard2.0)
  • System.Text.Json 10.0.5 — (transitive, microsoft, netstandard2.0)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Lyo.Pdf.Models:

Package Downloads
Lyo.Pdf

PDF processing library using PdfPig for reading and PDFsharp for creating and manipulating PDF documents.

Lyo.Pdf.Ocr

OCR pipeline for PDF pages: rasterize (PDFium), run IOcrEngine, map pixel boxes to PDF points.

Lyo.Pdf.Web.Components

Reusable Blazor components for PDF workbenches, annotation helpers, and HTML to PDF workflows.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 0 8/19/2026
1.0.1 37 8/18/2026
1.0.0 92 8/16/2026