Skip to content

PdfException

PdfException is the domain exception thrown by Validate PDF bytes and Validate a document when input bytes are not a recognisable PDF, a document reference is missing, or a document fails to load. (BR-03, BR-04, BR-06)

Purpose

  • Signals invalid PDF input or a failed document load as a distinct, catchable exception type rather than a generic Exception.

Context

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

Public members

Member Signature Purpose
PdfException(string) PdfException(string message) Constructs the exception with a descriptive message.
PdfException(string, Exception) PdfException(string message, Exception inner) Constructs the exception with a message and an inner exception.

Behavioral notes

  • ValidatePdf overloads throw PdfException synchronously; no operation in this library catches or wraps it further, so it propagates directly to the caller. (BR-03, BR-04, BR-06)

Constraints and usage notes

  • Catch PdfException specifically when a caller needs to distinguish invalid-PDF-input failures from other unexpected errors.

Sources

  • PdfAPI.Core\PdfException.cs