Skip to content

PdfResult

PdfResult is the result contract returned by every operation in the PDF platform — conversion, merge, and extraction all produce a PdfResult. Its multiple constructors set Status based on which constructor is invoked (success, failure, or source-type variants), and disposing a PdfResult cascades to its Document, deleting the backing file.

Purpose

  • Carries the outcome (Status), timing (Elapsed), and produced Document of a PDF operation.
  • Records which processing engine (PdfProcessorType) and, for conversions, which source format (SourceConversionType) were involved.
  • Derives its Status and identifying fields from the constructor used to create it. (BR-40, BR-45)

Context

  • Namespace: PdfAPI.Core
  • Assembly/package: PdfAPI.Core

Public members

Member Signature Purpose
Id Guid Id { get; set; } The result's own generated identity.
RequestId Guid RequestId { get; set; } The identity of the request this result answers; inherited from the originating PdfRequest.Id. (BR-40)
Options PdfOptions Options { get; set; } The output options that were applied when producing this result.
Message string Message { get; set; } A human-readable summary, such as the extracted page expression. (BR-18)
Elapsed TimeSpan Elapsed { get; set; } The time taken to produce this result.
Extension string Extension { get; set; } The file extension of the produced output.
OutputType string OutputType { get; set; } The type descriptor of the produced output.
OutputFormat PdfFormat OutputFormat { get; set; } The output format actually produced.
ImageId long ImageId { get; set; } The identifier of the associated image record, when applicable. (BR-40)
TrackingId long TrackingId { get; set; } The tracking record identifier associated with this result, when tracking is enabled.
PdfProcessorType PdfProcessorType PdfProcessorType { get; set; } The processing engine that produced this result. (BR-18)
SourceConversionType SourceConversionType SourceConversionType { get; set; } The originating source format behind a conversion, when set by the source-type constructor.
ConversionLog Document ConversionLog { get; set; } An optional log document describing the conversion process.
ErrCode [Obsolete] long ErrCode { get; set; } Legacy numeric error code retained for backward compatibility.*
Document Document Document { get; set; } The document produced by the operation.
Status PdfStatus Status { get; set; } The outcome status of the operation, set according to which constructor was used. (BR-45)
PdfResult (success, failure, source-type constructors) PdfResult(PdfRequest), PdfResult(PdfRequest, Exception), PdfResult(PdfRequest, SourceConversionType) Construct a result in the appropriate Status for the outcome being represented. (BR-45)
ToString() override string ToString() Renders a diagnostic summary of the result.
ToString(string) string ToString(string prefix) Renders a diagnostic summary of the result with a caller-supplied prefix.
Dispose() void Dispose() Disposes Document, deleting its backing file. (BR-24)

Behavioral notes

  • Disposing a PdfResult cascades to disposing Document, which deletes the produced file from disk. (BR-24)
  • ErrCode is marked obsolete, indicating diagnostics have moved to Status and Message.*

Constraints and usage notes

  • Do not dispose a PdfResult before the caller has finished reading or persisting its Document elsewhere, since disposal deletes the underlying file.

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.

Sources

  • PdfAPI.Core\PdfResult.cs