OfficeIMO.Html.Pdf 1.0.0

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

OfficeIMO.Html.Pdf

First-party bidirectional HTML/PDF conversion for OfficeIMO.

OfficeIMO.Html.Pdf is a thin adapter. It does not introduce a browser-grade HTML/CSS renderer or a second PDF parser. Instead, it exposes one named HTML/PDF bridge while reusing the existing OfficeIMO ingestion, logical read, and PDF engines:

  • Semantic profile: HTML → OfficeIMO.Markdown.HtmlMarkdownDocOfficeIMO.Markdown.PdfOfficeIMO.Pdf
  • Document profile: HTML → OfficeIMO.Word.HtmlWordDocumentOfficeIMO.Word.PdfOfficeIMO.Pdf
  • Semantic PDF profile: PDF → OfficeIMO.Pdf logical model → headings, paragraphs, lists, tables, and placeholders as semantic HTML
  • Positioned review profile: PDF → OfficeIMO.Pdf logical model → page wrappers with positioned text/table/link/form hints
using OfficeIMO.Html.Pdf;

string html = """
<h1>Quarterly update</h1>
<p>Generated by OfficeIMO.</p>
<table>
  <tr><th>Area</th><th>Status</th></tr>
  <tr><td>PDF bridge</td><td>Green</td></tr>
</table>
""";

html.SaveAsPdf("quarterly-update.pdf", new HtmlPdfSaveOptions {
    Profile = HtmlPdfProfile.Semantic
});
using OfficeIMO.Html.Pdf;

byte[] documentPdf = html.SaveAsPdf(HtmlPdfSaveOptions.CreateDocumentProfile());
using OfficeIMO.Html.Pdf;

string html = PdfHtmlConverter.ToHtml("quarterly-update.pdf", new PdfHtmlSaveOptions {
    Profile = PdfHtmlProfile.Semantic
});
using OfficeIMO.Html.Pdf;

PdfHtmlConverter.SaveAsHtml("quarterly-update.pdf", "quarterly-update-review.html", new PdfHtmlSaveOptions {
    Profile = PdfHtmlProfile.PositionedReview,
    IncludeLinkAnnotations = true,
    IncludeFormWidgets = true,
    ImageExportMode = PdfHtmlImageExportMode.EmbeddedDataUri
});
using OfficeIMO.Html.Pdf;

HtmlPdfProfileContract contract = HtmlPdfProfileContracts.Get(HtmlPdfProfile.Semantic);

Console.WriteLine(contract.Id);
Console.WriteLine(contract.FidelityContract);
using OfficeIMO.Html.Pdf;

PdfHtmlProfileContract contract = PdfHtmlProfileContracts.Get(PdfHtmlProfile.PositionedReview);

Console.WriteLine(contract.Id);
Console.WriteLine(contract.UnsupportedScope);
Console.WriteLine(string.Join(", ", contract.ReviewSignals));
using OfficeIMO.Html.Pdf;

byte[] pdf = File.ReadAllBytes("quarterly-update.pdf");
string reviewHtml = PdfHtmlConverter.ToHtml(pdf, new PdfHtmlSaveOptions {
    Profile = PdfHtmlProfile.PositionedReview,
    IncludeMetadata = true
});
using OfficeIMO.Html.Pdf;

PdfHtmlConversionResult result = PdfHtmlConverter.ToHtmlResult("quarterly-update.pdf", new PdfHtmlSaveOptions {
    Profile = PdfHtmlProfile.PositionedReview,
    IncludeLinkAnnotations = true
});

Console.WriteLine(result.Summary.ProfileId);
Console.WriteLine(result.Summary.ImagePlacementCount);

Use the semantic profile for articles, documentation, simple reports, and HTML that should become structured text. Use the document profile when the existing Word HTML converter is a better source model for the HTML being processed. HtmlPdfSaveOptions.CreateDocumentProfile() is the practical HTML-to-PDF preset for local/trusted print HTML with CSS, images, links, tables, and page-break hints; CreateTrustedDocumentProfile() also enables the trusted Word HTML stylesheet behavior. HtmlPdfSaveOptions.GetResourcePolicySummary() returns the active stylesheet/image resource policy, and document-profile HTML import diagnostics such as blocked stylesheets are forwarded into HtmlPdfSaveOptions.ConversionReport.

Use PDF semantic HTML for search, indexing, export, and review workflows where clean structure matters. Use positioned review HTML when callers need a page-oriented view of extracted PDF text/table/link/form/image geometry. Positioned image placeholders include CSS coordinates for browser review and a data-matrix attribute with the original PDF image transform for diagnostics, and complete extracted image files are embedded as data:image/...;base64,... URIs by default. Set ImageExportMode = PdfHtmlImageExportMode.PlaceholderOnly when callers need lightweight review HTML without embedded image bytes. Images whose drawing invocation cannot be matched are still emitted as page-scoped placeholders with a conversion warning instead of being silently dropped.

HtmlPdfProfileContracts.All and PdfHtmlProfileContracts.All expose stable profile identifiers, pipeline descriptions, intended use, fidelity guarantees, supported HTML/CSS/resource or PDF review signals, diagnostics, renderer boundaries, and unsupported scope for wrappers, manifests, UI selectors, and product docs. They are deliberately descriptive contracts rather than renderer switches: callers still choose behavior through HtmlPdfSaveOptions.Profile and PdfHtmlSaveOptions.Profile.

PdfHtmlConverter.ToHtmlResult(...) returns the generated HTML plus a PdfHtmlExportSummary with selected page numbers, text/table/image/link/form counts, image-placement counts, warning count, image export mode, and the active profile fidelity contract. Use it for sidecars, migration reports, and visual review galleries instead of scraping generated HTML.

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 234 7/14/2026
2.0.0 87 7/14/2026
1.0.13 211 7/9/2026
1.0.12 268 7/8/2026
1.0.11 424 7/5/2026
1.0.10 194 7/4/2026
1.0.9 209 6/27/2026
1.0.8 106 6/27/2026
1.0.7 363 6/24/2026
1.0.6 153 6/23/2026
1.0.5 273 6/21/2026
1.0.4 114 6/16/2026
1.0.3 294 6/16/2026
1.0.2 109 6/15/2026
1.0.1 226 6/13/2026
1.0.0 217 6/12/2026