OfficeIMO.Word.Pdf
3.0.2
Prefix Reserved
See the version list below for details.
dotnet add package OfficeIMO.Word.Pdf --version 3.0.2
NuGet\Install-Package OfficeIMO.Word.Pdf -Version 3.0.2
<PackageReference Include="OfficeIMO.Word.Pdf" Version="3.0.2" />
<PackageVersion Include="OfficeIMO.Word.Pdf" Version="3.0.2" />
<PackageReference Include="OfficeIMO.Word.Pdf" />
paket add OfficeIMO.Word.Pdf --version 3.0.2
#r "nuget: OfficeIMO.Word.Pdf, 3.0.2"
#:package OfficeIMO.Word.Pdf@3.0.2
#addin nuget:?package=OfficeIMO.Word.Pdf&version=3.0.2
#tool nuget:?package=OfficeIMO.Word.Pdf&version=3.0.2
OfficeIMO.Word.Pdf - Word/PDF conversion
OfficeIMO.Word.Pdf exports OfficeIMO.Word documents to PDF through the first-party OfficeIMO.Pdf engine and imports parser-supported PDF logical content into editable Word documents. It is the adapter layer: Word stays responsible for the .docx model, while PDF layout, reading, diagnostics, and writing stay in OfficeIMO.Pdf.
Install
dotnet add package OfficeIMO.Word.Pdf
Quick start
using OfficeIMO.Word;
using OfficeIMO.Word.Pdf;
using var document = WordDocument.Create("report.docx");
document.AddParagraph("PDF export").Style = WordParagraphStyles.Heading1;
document.AddParagraph("This document is exported through OfficeIMO.Pdf.");
document.SaveAsPdf("report.pdf");
Examples
Export with page and metadata options
using OfficeIMO.Pdf;
using OfficeIMO.Word;
using OfficeIMO.Word.Pdf;
using var document = WordDocument.Load("proposal.docx");
var options = new PdfSaveOptions {
Orientation = PdfPageOrientation.Portrait,
Margins = PageMargins.UniformCentimeters(1.5),
Title = "Customer proposal",
Author = "Evotec",
IncludePageNumbers = true,
PageNumberFormat = "Page {current} of {total}"
};
document.SaveAsPdf("proposal.pdf", options);
Export to bytes or streams
using OfficeIMO.Word;
using OfficeIMO.Word.Pdf;
using var document = WordDocument.Load("invoice.docx");
byte[] pdfBytes = document.ToPdf();
using var stream = File.Create("invoice.pdf");
document.SaveAsPdf(stream);
Capture conversion warnings without throwing away the report
using OfficeIMO.Word;
using OfficeIMO.Word.Pdf;
using var document = WordDocument.Load("complex-document.docx");
var options = new PdfSaveOptions {
DefaultTableBorders = true
};
var result = document.TrySaveAsPdf("complex-document.pdf", options);
if (!result.Succeeded) {
foreach (string diagnostic in result.Diagnostics) {
Console.WriteLine(diagnostic);
}
}
foreach (var warning in result.Warnings) {
Console.WriteLine($"{warning.Source}: {warning.Message}");
}
Import logical PDF tables into Word
using OfficeIMO.Word.Pdf;
var imported = PdfWordTableConverterExtensions.SaveTablesAsWordDocument(
"statement.pdf",
"statement-tables.docx");
foreach (var table in imported) {
Console.WriteLine($"Page {table.PageNumber}, table {table.TableIndex + 1}");
}
Import semantic PDF content into Word
using OfficeIMO.Pdf;
using OfficeIMO.Word.Pdf;
var options = new PdfWordReadOptions {
LayoutOptions = new PdfTextLayoutOptions {
ForceSingleColumn = true
}
};
var import = File.ReadAllBytes("packet.pdf").ToWordDocumentFromPdfResult(options);
using WordDocument word = import.Value;
byte[] docx = word.ToBytes();
foreach (var warning in import.Warnings) {
Console.WriteLine($"{warning.Code}: {warning.Message}");
}
The semantic import path preserves document metadata, page breaks, headings, paragraphs, lists, logical tables, safe URI hyperlinks, supported internal destination links, embedded images, form-widget placeholders, and conversion diagnostics when those structures are available in the PDF logical model. It creates an editable Word document; it does not claim fixed-layout page recreation or Microsoft Word rendering parity.
What it exports
- Paragraphs, headings, rich runs, links, bookmarks, page breaks, lists, and common spacing/indentation settings.
- Word sections, page size, orientation, margins, columns, headers, footers, page numbers, and document background color.
- Tables with common Word table styling, repeated headers, cell fills, borders, alignment, merged cells, and rich text in cells.
- Paragraph-aligned images, selected shapes, text boxes, content controls, simple form controls, footnote/endnote markers, and table-of-contents links where supported by the first-party PDF path.
- Per-operation conversion warnings through
PdfDocumentConversionResult.ReportorPdfSaveResult.Report.
What it imports
- Parser-supported PDF metadata, page breaks, headings, paragraphs, lists, logical tables, safe URI hyperlinks, supported internal destination links, complete image-file payloads with transparency-mask fidelity metadata, supported
ImageMaskstencil streams, color-key masked simple andIndexedstreams, Decode-aware soft-mask-capable simpleDeviceGray/DeviceRGB/basic-convertedDeviceCMYKstreams, basicICCBasedN=1/3/4 streams, and Decode-aware soft-mask-capableIndexedpalette PDF image streams into editable.docxcontent when their filters are supported. - Image fallback placeholders and form-widget placeholders with diagnostics instead of silently dropping unsupported objects.
- Page-range filtered imports through
PdfWordReadOptions.PageRanges. - Active hyperlink reconstruction for absolute
http,https, andmailtoURI annotations throughPdfWordReadOptions.ImportUriLinksandPdfWordReadOptions.AllowedHyperlinkUriSchemes. - Internal PDF destination reconstruction through
PdfWordReadOptions.ImportInternalLinks, mapping supported page and named destinations to Word bookmarks and anchor hyperlinks. - Native image embedding through
PdfWordReadOptions.ImportImages; complete image files, supportedImageMaskstencil streams, color-key masked simple andIndexedstreams, Decode-aware soft-mask-capable simple 8-bitDeviceGray/DeviceRGB/basic-convertedDeviceCMYKstreams, basicICCBasedN=1/3/4 streams, and Decode-aware soft-mask-capableIndexedpalette streams are embedded when their filters are supported. Pass-through JPEG image payloads with unresolved PDF transparency masks are embedded withPdfImageTransparencyMaskNotResolved; unsupported complex PDF image streams can still produce editable placeholders throughPdfWordReadOptions.IncludeImagePlaceholders. - Per-operation import warnings through
PdfWordConversionResult.Report.
Options and diagnostics
Use PdfSaveOptions when callers need to override page geometry, metadata, page-number behavior, font family, table-border fallback, profile presets, or text fallback policy. TextFallbacks uses the shared PdfTextFallbackFeatures enum. The balanced resource default enables installed fonts but denies arbitrary local and remote reads; use PdfResourcePolicy.CreatePortableDeterministic() for reproducible or untrusted conversion and CreateTrustedHost() only when local or remote resource access is intentional. Profiles do not inject page numbers; set IncludePageNumbers = true explicitly when generated numbering is desired. Request ToPdfDocumentResult() or TrySaveAsPdf() when diagnostics matter; unsupported Word features should become actionable operation results instead of mutable option state. Available embeddable Word families use shared named PDF resources and are not limited to three compatibility slots. Unavailable or non-embeddable families fall back to a mapped PDF font with an explicit warning.
Boundaries
- This package does not try to be a full Word renderer with perfect Microsoft Word parity or a fixed-layout PDF-to-DOCX recreation engine.
- PDF-to-Word import is semantic reconstruction over parser-supported logical PDF objects. Complex/unsupported PDF image streams, interactive controls, unresolved destinations, and remote/cross-document PDF navigation actions are not yet reconstructed as native Word objects.
- Unsupported or simplified Word features should surface warnings rather than being hidden in the README as broad claims.
- Reusable PDF layout work belongs in
OfficeIMO.Pdf; Word-specific mapping belongs here. - PowerShell PDF workflows should be exposed through PSWriteOffice.
Related packages
- OfficeIMO.Word - Word document model.
- OfficeIMO.Pdf - PDF creation, reading, and manipulation engine.
- OfficeIMO.Html.Pdf - HTML/PDF bridge built on OfficeIMO converters.
Targets and license
- Targets:
netstandard2.0,net8.0,net10.0. - License: MIT.
- Repository: EvotecIT/OfficeIMO
Dependency footprint
- External: None beyond the dependencies of its OfficeIMO format packages; no browser, native renderer, or commercial PDF SDK.
- OfficeIMO:
OfficeIMO.Word,OfficeIMO.Pdf, andOfficeIMO.Drawingown the source model, PDF engine, mapping, and reports.
See the complete OfficeIMO package map for related formats and conversion paths.
| 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.Drawing (>= 3.0.2)
- OfficeIMO.Pdf (>= 3.0.2)
- OfficeIMO.Word (>= 3.0.2)
-
.NETStandard 2.0
- OfficeIMO.Drawing (>= 3.0.2)
- OfficeIMO.Pdf (>= 3.0.2)
- OfficeIMO.Word (>= 3.0.2)
-
net10.0
- OfficeIMO.Drawing (>= 3.0.2)
- OfficeIMO.Pdf (>= 3.0.2)
- OfficeIMO.Word (>= 3.0.2)
-
net8.0
- OfficeIMO.Drawing (>= 3.0.2)
- OfficeIMO.Pdf (>= 3.0.2)
- OfficeIMO.Word (>= 3.0.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on OfficeIMO.Word.Pdf:
| Package | Downloads |
|---|---|
|
Ank.DocToolkit
Convert HTML to DOCX and PDF, and open/edit DOCX, XLSX and PPTX - pure managed, no native binaries, no browser, no LibreOffice. Runs on Linux. |
|
|
OfficeIMO.OpenDocument.Pdf
Direct loss-aware OpenDocument text, spreadsheet, and presentation to PDF adapters. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.3 | 1,796 | 7/27/2026 |
| 3.0.2 | 137 | 7/26/2026 |
| 3.0.1 | 386 | 7/26/2026 |
| 3.0.0 | 502 | 7/20/2026 |
| 2.0.1 | 260 | 7/14/2026 |
| 2.0.0 | 97 | 7/14/2026 |
| 1.0.49 | 287 | 7/9/2026 |
| 1.0.48 | 319 | 7/8/2026 |
| 1.0.47 | 485 | 7/5/2026 |
| 1.0.46 | 242 | 7/4/2026 |
| 1.0.45 | 1,133 | 6/27/2026 |
| 1.0.44 | 177 | 6/27/2026 |
| 1.0.43 | 434 | 6/24/2026 |
| 1.0.42 | 222 | 6/23/2026 |
| 1.0.41 | 343 | 6/21/2026 |
| 1.0.40 | 192 | 6/16/2026 |
| 1.0.39 | 371 | 6/16/2026 |
| 1.0.38 | 708 | 6/15/2026 |
| 1.0.37 | 297 | 6/13/2026 |
| 1.0.36 | 266 | 6/12/2026 |