Skip to content

OP-IS-PDF: Validate is-PDF

Reports whether the submitted bytes carry a valid PDF file signature.

Field Value
Operation ID OP-IS-PDF
Trigger Client submits POST v1/info/validate with arbitrary bytes
Entry endpoint POST v1/info/validate
Owning component InfoController.IsPdf(byte[]) → PdfClientService.IsPdf(byte[])
Inputs Request body: byte[]
Outputs Bare bool
Failure response Always returns 200; no failure path is triggered by a non-PDF payload

Steps

  1. PdfClientService.IsPdf checks the %PDF- file signature and returns true/false rather than throwing on a non-PDF payload (BR-PDFAPI-005).

This check is implemented in PdfAPI.Core (PdfClientService.IsPdf), documented in full at Test whether bytes are a PDF (OP-03); its behavior is summarized here only as observed on this request path.

Origin: The file-signature check described in this step is implemented in PdfAPI.Core, not in PdfAPI. See the linked operation page for the full delegated logic. 2. The bare bool is returned — HTTP 200.

Process flow

The following diagram shows the file-signature check sequence.

flowchart TD
    A["POST v1/info/validate"] --> B["IsPdf: check file signature"]
    B --> C["Return true/false, 200"]

Transaction and side effects

Aspect Finding
Unit of work None
Commit point Not applicable — no database access
Records written None
Downstream calls None
Repeat-call behavior Read-only; safe to repeat

Logging

Surface Written content
— No dedicated logging observed on this path

Error handling

  • No error status codes are identified on this path — a non-PDF payload returns false rather than failing (BR-PDFAPI-005).

Sources

  • PdfAPI\Controllers\v1\InfoController.cs
  • PdfAPI.Core\Services\PdfClientService.cs