# `inspect_pdf_document` — Inspect Binary PDF Structure & Metadata

> Part of [PDF Forge & Layout Diagnostics Edge API](https://pdf-forge.apikeg.com/llms.txt) (`com.apikeg/pdf-forge`)

Parses a Base64-encoded PDF binary to verify %PDF header/EOF integrity and extract pdfVersion, exact pageCount, byteLength, encryption status, AcroForm presence, and Info dictionary metadata.

**Why call instead of DIY:** Instant deterministic PDF preflight without installing native poppler/pdfinfo binaries; $0.001 per check.

- **REST Endpoint:** `POST https://pdf-forge.apikeg.com/v1/inspect-pdf-document`
- **MCP Server:** `https://pdf-forge.apikeg.com/mcp` (tool: `inspect_pdf_document`)
- **Pricing:** $0.001 USD per PDF binary inspection (x402 instant micropayment)
- **Free Dry-Run:** `POST https://pdf-forge.apikeg.com/v1/inspect-pdf-document?dry_run=true`

## Input JSON Schema
```json
{
  "type": "object",
  "properties": {
    "pdfBase64": {
      "type": "string",
      "minLength": 8,
      "maxLength": 5242880,
      "description": "Base64-encoded PDF binary (standard or URL-safe Base64, optional 'data:application/pdf;base64,' prefix)."
    }
  },
  "required": [
    "pdfBase64"
  ],
  "additionalProperties": false
}
```

## Examples
### Verify compiled PDF page count and metadata
```bash
curl -X POST "https://pdf-forge.apikeg.com/v1/inspect-pdf-document" \
  -H "Content-Type: application/json" \
  -d '{"pdfBase64":"JVBERi0xLjcK..."}'
```
Expected output: validPdf=true, pdfVersion='1.7', pageCount, byteLength, encrypted=false, hasAcroForm=false, and metadata.
