OfficeIMO.Html.Pdf
3.6.0
Prefix Reserved
See the version list below for details.
dotnet add package OfficeIMO.Html.Pdf --version 3.6.0
NuGet\Install-Package OfficeIMO.Html.Pdf -Version 3.6.0
<PackageReference Include="OfficeIMO.Html.Pdf" Version="3.6.0" />
<PackageVersion Include="OfficeIMO.Html.Pdf" Version="3.6.0" />
<PackageReference Include="OfficeIMO.Html.Pdf" />
paket add OfficeIMO.Html.Pdf --version 3.6.0
#r "nuget: OfficeIMO.Html.Pdf, 3.6.0"
#:package OfficeIMO.Html.Pdf@3.6.0
#addin nuget:?package=OfficeIMO.Html.Pdf&version=3.6.0
#tool nuget:?package=OfficeIMO.Html.Pdf&version=3.6.0
OfficeIMO.Html.Pdf
OfficeIMO.Html.Pdf joins the HTML and PDF engines in both directions: it renders HTML to PDF, exports PDF-backed HTML page images (PNG, JPEG, TIFF, WebP and SVG), and converts PDF to semantic or positioned-review HTML. OfficeIMO.Html owns parsing, CSS and the provider-neutral layout scene and does not reference OfficeIMO.Pdf.
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");
PdfHtmlExportOptions semanticOptions = PdfHtmlExportOptions.CreateSemanticProfile(
OfficeVisualThemeKind.TechnicalDocument);
semanticOptions.ReadOptions = new PdfLoadOptions {
PageSelection = PdfPageSelection.Parse("1-20"),
Pipeline = new PdfUnderstandingPipelineOptions { MaxPages = 20 }
};
string semantic = sourcePdf.ToHtml(semanticOptions);
PdfHtmlExportOptions reviewOptions = PdfHtmlExportOptions.CreatePositionedReviewProfile(
OfficeVisualThemeKind.Report);
reviewOptions.ImageExportMode = PdfHtmlImageExportMode.EmbeddedDataUri;
OfficeIMO.OfficeConversionReport saveReport = sourcePdf.SaveAsHtml("quarterly-review.html", reviewOptions);
string review = sourcePdf.ToHtml(reviewOptions, out OfficeIMO.OfficeConversionReport report);
foreach (OfficeIMO.OfficeDiagnostic diagnostic in report.Diagnostics) {
Console.WriteLine($"{diagnostic.Code}: {diagnostic.Message}");
}
The named profiles emit the shared responsive OfficeIMO document shell, stable profile metadata, and adapter-owned PDF review styles. ToHtml(options, out report), its async result and SaveAsHtml expose immutable OfficeConversionReport snapshots after conversion completes. 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 report.ThrowIfLoss() 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; HtmlPdfExportOptions extends that shared options type with PDF-only settings. PDF page images use OfficeIMO.Pdf's ToImage(options) / ExportImages(...) 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.
The logical positioned projection is used 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 PdfHtmlExportOptions.UseSharedPageReadingOrder = false only when source sequence is deliberately preferred; positioned-review output always retains source geometry.
PdfHtmlExportOptions.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 native read uses the loaded source document and these semantic settings.
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 | 1 | 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.6.0)
- OfficeIMO.Html (>= 3.6.0)
- OfficeIMO.Pdf (>= 3.6.0)
-
.NETStandard 2.0
- OfficeIMO.Core (>= 3.6.0)
- OfficeIMO.Html (>= 3.6.0)
- OfficeIMO.Pdf (>= 3.6.0)
-
net10.0
- OfficeIMO.Core (>= 3.6.0)
- OfficeIMO.Html (>= 3.6.0)
- OfficeIMO.Pdf (>= 3.6.0)
-
net8.0
- OfficeIMO.Core (>= 3.6.0)
- OfficeIMO.Html (>= 3.6.0)
- OfficeIMO.Pdf (>= 3.6.0)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on OfficeIMO.Html.Pdf:
| Package | Downloads |
|---|---|
|
OfficeIMO.Mhtml.Pdf
Direct MHTML-to-PDF conversion for OfficeIMO. |
|
|
OfficeIMO.Epub.Image
Thin EPUB-to-image adapter over OfficeIMO.Html and OfficeIMO.Drawing. |
|
|
OfficeIMO
Document conversion and resumable batches over the OfficeIMO format libraries. |
|
|
OfficeIMO.Email.Image
HTML-backed image rendering for OfficeIMO email documents. |
|
|
OfficeIMO.Workflows
Typed local document workflows that compose first-party OfficeIMO conversion, PDF, and provenance capabilities. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.6.1 | 316 | 11/10/2026 |
| 3.6.0 | 442 | 11/6/2026 |
| 3.5.3 | 338 | 10/31/2026 |
| 3.5.2 | 422 | 10/24/2026 |
| 3.5.1 | 365 | 10/16/2026 |
| 3.4.5 | 818 | 10/10/2026 |
| 3.4.4 | 433 | 9/27/2026 |
| 3.4.3 | 363 | 9/12/2026 |
| 3.4.2 | 233 | 9/9/2026 |
| 3.4.1 | 251 | 9/7/2026 |
| 3.4.0 | 200 | 9/6/2026 |
| 3.3.0 | 66,187 | 9/2/2026 |
| 3.2.7 | 3,149 | 8/29/2026 |
| 3.2.6 | 336 | 8/22/2026 |
| 3.2.5 | 243 | 8/21/2026 |
| 3.2.4 | 274 | 8/19/2026 |
| 3.2.3 | 162 | 8/17/2026 |
| 3.2.2 | 363 | 8/13/2026 |
| 3.2.1 | 297 | 8/11/2026 |
| 3.2.0 | 455 | 8/7/2026 |