Lyo.Pdf.Models 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Lyo.Pdf.Models --version 2.0.0
                    
NuGet\Install-Package Lyo.Pdf.Models -Version 2.0.0
                    
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="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lyo.Pdf.Models" Version="2.0.0" />
                    
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 2.0.0
                    
#r "nuget: Lyo.Pdf.Models, 2.0.0"
                    
#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@2.0.0
                    
#: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=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Lyo.Pdf.Models&version=2.0.0
                    
Install as a Cake Tool

Lyo.Pdf.Models

PDF stack contracts and value types. Lyo.Pdf implements them, so you can take IPdfService, IPdfReader, IPdfWriter, and ITextExtractor without a direct PdfPig or PDFsharp reference.

Service contracts

  • IPdfService. Open PDFs (OpenFromFile/Bytes/Stream plus …Async and batch variants), open URLs (OpenFromUrlAsync / OpenFromUrlsAsync, async only), create empty docs or open for edit (CreateEmpty, OpenForEdit / OpenForEditAsync), and merge (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 safe across threads.
  • IPdfWriter (IDisposable). PdfSharp 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. IPdfDocumentText + IPdfDocumentSections composed together, reached 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). Each method has matching sync and async variants.
  • IPdfDocumentSections. Slice by section: GetWordsBetweenSections, GetLinesBetweenSections / GetLinesBetweenSectionsAsync, GetSection / GetSectionAsync. Navigation is anchored by ordered section labels with optional defaultEndSection, startPage, endPage, and yTolerance.

Value types

  • PdfInfo. PageCount, 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 that sit on the same visual row.
  • PdfBoundingBox(Page, Box). 1-based page plus Lyo.Common.Metadata.Records.BoundingBox2D expressed in PDF points.
  • PdfColumnarText(Columns) plus ToCombinedString(separator).
  • PdfSection(Name, StartPage, EndPage, Lines) plus a computed Words property.
  • ColumnHeader(Label, IsKey = false). Controls table extraction. IsKey columns start a new row. Other columns let unmatched lines append to the previous row.
  • KvColumnResult(ColumnIndex, Values) plus a KvColumnResult.Merge(...) helper.
  • PdfKeyValueLayout. Horizontal (value sits to the right of the key) or Vertical (value sits below the key).
  • PdfInferFormattingFlags. None, Bold, Semicolon (labels terminated by punctuation), Underline.

Options

  • PdfServiceOptions. AddPdfService(...) registers this as a singleton: 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". There is no shared catalog and no total-loaded-bytes cap; the caller owns each IPdfReader.

TFMs

netstandard2.0;net10.0. Depends on Lyo.Common.Core, Lyo.Exceptions, Lyo.Metrics, Lyo.Result, and Lyo.DataTable.Models.

Dependencies

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

  • Lyo.Common.Metadata (direct, lyo)
  • Lyo.DataTable.Models (direct, lyo)
  • Lyo.Metrics (direct, lyo)
  • Lyo.Result (direct, lyo)
  • Lyo.Common.Core (transitive, lyo)
  • Lyo.Exceptions (transitive, lyo)
  • Microsoft.Bcl.AsyncInterfaces 10.0.5 (transitive, microsoft, netstandard2.0)
  • 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.Web.Components

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

Lyo.Pdf.Ocr

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

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 137 9/14/2026
2.0.0 155 9/9/2026
1.0.13 161 8/25/2026
1.0.11 170 8/23/2026
1.0.9 178 8/22/2026
1.0.6 182 8/20/2026
1.0.4 183 8/20/2026
1.0.3 168 8/19/2026
1.0.2 166 8/19/2026
1.0.1 178 8/18/2026
1.0.0 167 8/16/2026