OfficeIMO.Html.Pdf
3.5.2
Prefix Reserved
dotnet add package OfficeIMO.Html.Pdf --version 3.5.2
NuGet\Install-Package OfficeIMO.Html.Pdf -Version 3.5.2
<PackageReference Include="OfficeIMO.Html.Pdf" Version="3.5.2" />
<PackageVersion Include="OfficeIMO.Html.Pdf" Version="3.5.2" />
<PackageReference Include="OfficeIMO.Html.Pdf" />
paket add OfficeIMO.Html.Pdf --version 3.5.2
#r "nuget: OfficeIMO.Html.Pdf, 3.5.2"
#:package OfficeIMO.Html.Pdf@3.5.2
#addin nuget:?package=OfficeIMO.Html.Pdf&version=3.5.2
#tool nuget:?package=OfficeIMO.Html.Pdf&version=3.5.2
OfficeIMO.Html.Pdf
OfficeIMO.Html.Pdf converts PDF to semantic or positioned-review HTML. HTML-to-PDF generation and PDF-backed page image export are owned by OfficeIMO.Html. Their public types retain the OfficeIMO.Html.Pdf namespace.
Use OfficeIMO.Html.Pdf.Browser when the source is a live website or its final output depends on JavaScript or browser layout. That package asks HtmlTinkerX to capture the page, then opens the generated bytes as a normal OfficeIMO.Pdf.PdfDocument. Browser capture is explicit; this managed renderer does not fall back to Chromium automatically.
Install
dotnet add package OfficeIMO.Html.Pdf
HTML to PDF
See the HTML renderer guide for conversion, explicit render profiles and shared image options.
ZIP site bundles
See bounded ZIP site-bundle PDF conversion.
Paged-media and PDF semantics
See the paged-media, tagging and Formula attachment contract.
Fonts and text shaping
See the shared HTML/PDF font and shaping settings.
PDF to HTML
using OfficeIMO.Drawing;
using OfficeIMO.Html.Pdf;
using OfficeIMO.Pdf;
PdfDocument sourcePdf = PdfDocument.Load("quarterly-update.pdf");
PdfToHtmlOptions semanticOptions = PdfToHtmlOptions.CreateSemanticProfile(
OfficeVisualThemeKind.TechnicalDocument);
semanticOptions.ReadOptions = new PdfReadOptions {
PageSelection = PdfPageSelection.Parse("1-20"),
Pipeline = new PdfUnderstandingPipelineOptions { MaxPages = 20 }
};
string semantic = sourcePdf.ToHtml(semanticOptions);
PdfToHtmlOptions reviewOptions = PdfToHtmlOptions.CreatePositionedReviewProfile(
OfficeVisualThemeKind.Report);
reviewOptions.ImageExportMode = PdfHtmlImageExportMode.EmbeddedDataUri;
PdfConversionReport saveReport = sourcePdf.SaveAsHtml("quarterly-review.html", reviewOptions).RequireSuccess().Report!;
PdfHtmlConversionResult reviewResult = sourcePdf.ToHtmlResult(reviewOptions);
foreach (PdfConversionWarning warning in reviewResult.Report.Warnings) {
Console.WriteLine($"{warning.Code}: {warning.Message}");
}
The named profiles emit the shared responsive OfficeIMO document shell, stable profile metadata, and adapter-owned PDF review styles. PdfHtmlConversionResult.Report and the report returned by save APIs retain the established PdfConversionReport type but are frozen snapshots (IsReadOnly is true); the mutable report used while conversion is in progress is never exposed as result state. The positioned-review profile also enables inert link and form-widget overlays. Set IncludeDefaultStyles = false to omit the theme and presentation layer. Positioned output still emits its minimal structural CSS because absolute page geometry is part of that profile's fidelity contract.
Choose semantic HTML when readable headings, paragraphs, lists, and tables matter most. Choose positioned review when page geometry and visual comparison matter most. Semantic output reports its unavoidable reflow as a typed approximation. Both profiles report omitted vectors, images, links, forms, annotations, and outlines as typed omissions when the selected profile or options cannot represent them. Report.HasLoss and RequireNoLoss() therefore provide a strict acceptance gate; ordinary semantic conversion is expected to report approximation rather than claim pixel fidelity.
PdfHtmlImageExportMode.PlaceholderOnly retains readable image metadata but omits the source pixels and reports that omission. EmbeddedDataUri embeds supported image files within the configured byte and output-size limits and reports any fallback to a placeholder. Fully transparent and unplaced resources are suppressed, while images whose clips, soft masks, unresolved transparency masks, or unsupported blend modes could reveal hidden pixels are represented without the raw data URI and reported as typed omissions. Supported opacity and blend modes are mapped to CSS with diagnostics where browser compositing can differ from PDF compositing.
PDF-to-HTML profiles describe how an existing PDF is projected to review HTML. They are unrelated to HTML-to-PDF, which has one direct rendering path. HTML-to-PDF and HTML-to-PNG/JPEG/TIFF/SVG/WebP use the same HtmlRenderOptions scene and diagnostics; HtmlToPdfOptions extends that shared options type with PDF-only settings. PDF page images use OfficeIMO.Pdf's ToImage() / ToImages() API instead of routing through HTML. An image is embedded into HTML as a resource; turning image pixels into document structure is an OCR workflow, not an image-rendering profile.
When the source is an opened PdfDocument, positioned review uses the shared PDF drawing renderer to retain supported vector artwork, clipping, paint order, images, and embedded fonts as an embedded SVG image. Text remains selectable. Browser font substitution can affect text whose fonts are unavailable, and renderer diagnostics appear in the conversion report.
Already-read logical documents use the logical positioned projection because they do not retain the original drawing resources. Opened documents also use that projection for pages with form widgets, restricted reading-order projection, or image settings that require placeholders, omission, or a smaller byte limit. OCR-only pages keep the visual appearance layer and add a transparent searchable text overlay. Check the report for content that could not be reproduced; positioned review is not a guarantee of identical appearance for every PDF.
Semantic output uses the shared crop-, rotation-, spanning-band-, and column-aware PDF reading order by default. Set PdfToHtmlOptions.UseSharedPageReadingOrder = false only when source sequence is deliberately preferred; positioned-review output always retains source geometry.
PdfToHtmlOptions.ReadOptions configures the canonical semantic read for an opened PdfDocument. Existing PageRanges take precedence over ReadOptions.PageSelection; the profile, layout, and semantic budgets still come from ReadOptions. The setting is ignored when the source is already a PdfDocumentReadResult.
Targets and license
- Targets:
netstandard2.0,net8.0,net10.0. - License: MIT.
- Repository: EvotecIT/OfficeIMO
Dependency footprint
- External: None beyond AngleSharp/AngleSharp.Css already isolated in
OfficeIMO.Html; no browser process or native HTML renderer. - OfficeIMO:
OfficeIMO.Html,OfficeIMO.Pdf, andOfficeIMO.Coreown layout, rendering, reverse projection, and reports.
See the complete OfficeIMO package map for related formats and conversion paths.
Generated capability summary
This table is generated from the package-neutral OfficeIMO operation catalog. The detailed source contracts remain authoritative for feature-level behavior and limitations.
| Operation | Supported | Partial | Preserved | Rejected | Unsupported | Not applicable |
|---|---|---|---|---|---|---|
| Convert | 0 | 1 | 0 | 0 | 0 | 0 |
The complete rows for OfficeIMO.Html.Pdf are published in the generated operation contract.
| Product | Versions 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 is compatible. 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 is compatible. 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. |
-
.NETFramework 4.7.2
- OfficeIMO.Core (>= 3.5.2)
- OfficeIMO.Html (>= 3.5.2)
- OfficeIMO.Pdf (>= 3.5.2)
-
.NETStandard 2.0
- OfficeIMO.Core (>= 3.5.2)
- OfficeIMO.Html (>= 3.5.2)
- OfficeIMO.Pdf (>= 3.5.2)
-
net10.0
- OfficeIMO.Core (>= 3.5.2)
- OfficeIMO.Html (>= 3.5.2)
- OfficeIMO.Pdf (>= 3.5.2)
-
net8.0
- OfficeIMO.Core (>= 3.5.2)
- OfficeIMO.Html (>= 3.5.2)
- OfficeIMO.Pdf (>= 3.5.2)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on OfficeIMO.Html.Pdf:
| Package | Downloads |
|---|---|
|
OfficeIMO.Mhtml.Pdf
Direct MHTML-to-PDF conversion for OfficeIMO. |
|
|
OfficeIMO.Workflows
Typed local document workflows that compose first-party OfficeIMO conversion, PDF, and provenance capabilities. |
|
|
OfficeIMO.Chm.Pdf
CHM help-book conversion through the OfficeIMO HTML and PDF engines. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.5.2 | 56 | 10/24/2026 |
| 3.5.1 | 277 | 10/16/2026 |
| 3.4.5 | 790 | 10/10/2026 |
| 3.4.4 | 425 | 9/27/2026 |
| 3.4.3 | 359 | 9/12/2026 |
| 3.4.2 | 227 | 9/9/2026 |
| 3.4.1 | 241 | 9/7/2026 |
| 3.4.0 | 193 | 9/6/2026 |
| 3.3.0 | 55,619 | 9/2/2026 |
| 3.2.7 | 3,145 | 8/29/2026 |
| 3.2.6 | 331 | 8/22/2026 |
| 3.2.5 | 238 | 8/21/2026 |
| 3.2.4 | 267 | 8/19/2026 |
| 3.2.3 | 155 | 8/17/2026 |
| 3.2.2 | 354 | 8/13/2026 |
| 3.2.1 | 291 | 8/11/2026 |
| 3.2.0 | 450 | 8/7/2026 |
| 3.1.1 | 143 | 8/7/2026 |
| 3.1.0 | 130 | 8/6/2026 |
| 3.0.3 | 157 | 7/27/2026 |