Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PdfDocumentConversionResult

OfficeIMO.Pdf

Namespace
OfficeIMO.Pdf
Assembly
OfficeIMO.Pdf
Source revision
be6c300e4ab1 with working tree changes
Implements
IOfficeResult<PdfDocument> IOfficeResult
Modifiers
sealed

Result of a source-document to PDF conversion, pairing the generated PDF document with a snapshot of conversion diagnostics.

Inheritance

  • object
  • PdfDocumentConversionResult

Usage

Explore 4 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Constructors

public PdfDocumentConversionResult(PdfDocument document, PdfConversionReport conversionReport) #

Creates a conversion result from a generated PDF document and the conversion report populated during export.

Parameters

document OfficeIMO.Pdf.PdfDocument required
conversionReport OfficeIMO.Pdf.PdfConversionReport required

Methods

public PdfConversionProofReport AssertProof(PdfConversionProofOptions? options = null) #

Builds a conversion proof snapshot and throws when requested proof checks fail.

Parameters

options OfficeIMO.Pdf.PdfConversionProofOptions? = null optional
public PdfConversionProofReport AssessArtifactProof(byte[] artifact, PdfConversionProofOptions? options = null) #

Checks the supplied serialized artifact without serializing the document again. Call after PdfDocumentConversionResult.ToBytes to bind readback and hash checks to the bytes actually saved. Conversion diagnostics are taken from this result; the caller must supply its corresponding artifact.

Parameters

artifact byte[] required
options OfficeIMO.Pdf.PdfConversionProofOptions? = null optional
public PdfConversionProofReport AssessProof(PdfConversionProofOptions? options = null) #

Builds a reusable proof snapshot for the generated PDF and captured conversion diagnostics.

Parameters

options OfficeIMO.Pdf.PdfConversionProofOptions? = null optional
public PdfDocumentConversionResult Process(Func<PdfDocument, PdfDocument> process) #

Applies PDF post-processing while preserving the captured conversion diagnostics in the returned result.

Parameters

process System.Func<OfficeIMO.Pdf.PdfDocument, OfficeIMO.Pdf.PdfDocument> required
public PdfDocument RequireValue() #

Returns the generated PDF document.

Save 6 overloads
public PdfSaveResult Save(Stream stream) #

Writes the generated PDF document to the supplied stream and returns conversion plus output evidence.

Parameters

stream System.IO.Stream required
public PdfSaveResult Save(Stream stream, CancellationToken cancellationToken) #

Writes the converted PDF while observing cancellation.

Parameters

stream System.IO.Stream required
cancellationToken System.Threading.CancellationToken required
public PdfSaveResult Save(Stream stream, bool failOnLoss, CancellationToken cancellationToken = default) #

Writes the converted PDF. With failOnLoss, bytes are staged privately and published only when every conversion stage remains lossless.

Parameters

stream System.IO.Stream required
failOnLoss bool required
cancellationToken System.Threading.CancellationToken = default optional
public PdfSaveResult Save(string path) #

Writes the generated PDF document to the supplied file path and returns conversion plus output evidence.

Parameters

path string required
public PdfSaveResult Save(string path, CancellationToken cancellationToken) #

Writes the converted PDF while observing cancellation.

Parameters

path string required
cancellationToken System.Threading.CancellationToken required
public PdfSaveResult Save(string path, bool failOnLoss, CancellationToken cancellationToken = default) #

Writes the converted PDF. With failOnLoss, bytes are staged privately and committed atomically only when every conversion stage remains lossless.

Parameters

path string required
failOnLoss bool required
cancellationToken System.Threading.CancellationToken = default optional
SaveAsync 4 overloads
public async Task<PdfSaveResult> SaveAsync(Stream stream, CancellationToken cancellationToken = default) #

Asynchronously writes the generated PDF document to the supplied stream and returns conversion plus output evidence.

Parameters

stream System.IO.Stream required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<PdfSaveResult>
public async Task<PdfSaveResult> SaveAsync(Stream stream, bool failOnLoss, CancellationToken cancellationToken = default) #

Asynchronously writes the converted PDF. With failOnLoss, bytes are staged privately and published only when every conversion stage remains lossless.

Parameters

stream System.IO.Stream required
failOnLoss bool required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<PdfSaveResult>
public async Task<PdfSaveResult> SaveAsync(string path, CancellationToken cancellationToken = default) #

Asynchronously writes the generated PDF document to the supplied file path and returns conversion plus output evidence.

Parameters

path string required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<PdfSaveResult>
public async Task<PdfSaveResult> SaveAsync(string path, bool failOnLoss, CancellationToken cancellationToken = default) #

Asynchronously writes the converted PDF. With failOnLoss, bytes are staged privately and committed atomically only when every conversion stage remains lossless.

Parameters

path string required
failOnLoss bool required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<PdfSaveResult>
public void ThrowIfLoss() #

Throws an OfficeConversionException when any source or PDF conversion stage reports possible content loss.

ToBytes 3 overloads
public byte[] ToBytes() #

Returns the generated PDF bytes.

Returns

byte[]
public byte[] ToBytes(CancellationToken cancellationToken) #

Renders the converted PDF while observing cancellation.

Parameters

cancellationToken System.Threading.CancellationToken required

Returns

byte[]
public byte[] ToBytes(bool failOnLoss, CancellationToken cancellationToken = default) #

Renders the converted PDF. With failOnLoss, bytes are staged privately and returned only when every conversion stage remains lossless.

Parameters

failOnLoss bool required
cancellationToken System.Threading.CancellationToken = default optional

Returns

byte[]
public PdfDocumentConversionResult WithAdditionalWarnings(IEnumerable<PdfConversionWarning> warnings) #

Returns a new conversion result that prepends adapter or source-projection warnings while retaining the original converter report as a live linked source for save-time diagnostics.

Parameters

warnings System.Collections.Generic.IEnumerable<OfficeIMO.Pdf.PdfConversionWarning> required
public PdfDocumentConversionResult WithSourceConversionReport(OfficeConversionReport report) #

Returns a new conversion result with a typed source-stage report prepended before existing source stages and the PDF-stage report.

Parameters

report OfficeIMO.OfficeConversionReport required
public PdfDocumentConversionResult WithValue(PdfDocument value) #

Returns a new conversion result with the supplied PDF document while preserving the captured conversion diagnostics.

Parameters

value OfficeIMO.Pdf.PdfDocument required

Properties

public PdfDocument Value { get; } #

The generated PDF document, ready for fluent OfficeIMO.Pdf processing.

public bool Succeeded { get; } #

True because a conversion result is created only after the PDF document model exists.

public PdfPipelineReport Pipeline { get; } #

Create/open and post-processing evidence accumulated by the generated PDF document.

public PdfConversionReport Report { get; } #

Snapshot of PDF-stage warnings captured when the result was created and refreshed after save-time diagnostics run.

public IReadOnlyList<OfficeConversionReport> SourceConversionReports { get; } #

Reports from semantic or format-projection stages that ran before PDF layout.

public IReadOnlyList<OfficeConversionReport> ConversionReports { get; } #

Ordered source-stage reports followed by the PDF-stage report.

public IReadOnlyList<PdfConversionWarning> Warnings { get; } #

Warnings captured by the PDF conversion stage.

public bool HasWarnings { get; } #

True when the PDF conversion stage produced at least one warning.

public bool HasLoss { get; } #

True when any source or PDF conversion stage reported possible content loss.

public IReadOnlyList<OfficeDiagnostic> Diagnostics { get; } #

All source and PDF-stage diagnostics with their original loss categories preserved.

public PdfConversionReportSummary Summary { get; } #

Counts grouped conversion diagnostics captured with this result.