{"uid":"cap_L1bvbtXQnX9ZW3LRRh8Ek","slug":"pdf-header-inspector-441781ff","name":"PDF Header Inspector","description":"Read a PDF's version and header position from its first bytes; flags junk before %PDF- and an invalid version.","url":"https://file-formats.x402tookit.com/pdf-header?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["hex"],"properties":{"hex":{"type":"string","description":"First bytes of the PDF as hex, up to 512 bytes"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"major":{"type":["null","number"]},"minor":{"type":["null","number"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"]},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"version":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"binaryMarker":{"type":["boolean","null"]},"headerOffset":{"type":["null","number"]},"validVersion":{"type":["boolean","null"]},"bytesExamined":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lbBv4_ud7Dai7riWZOt4J","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Reads PDF version and header position from the first bytes of a file, flagging junk before %PDF- and invalid version strings.","exampleAgentPrompt":"Check the PDF header from these first bytes and tell me the version, where the %PDF- marker starts, and whether the header is valid: 255044462d312e340a...","exampleUseCases":[{"title":"Validate uploaded PDF file integrity","prompt":"I just received a file claiming to be a PDF — here are its first 512 bytes as hex: 255044462d312e340a. Can you check if the %PDF- header is in the right place, what version it is, and whether it's a valid PDF header?"},{"title":"Detect disguised or corrupted PDFs","prompt":"This file is supposed to be a PDF but it might have junk prepended before the real header. Inspect these opening bytes — 0000000000255044462d322e30 — and tell me the header offset, version, and any issues flagged."},{"title":"Audit PDF version in document pipeline","prompt":"For quality control, I need to know the PDF version of this document — here are the first bytes in hex: 255044462d312e360a. Tell me the major and minor version numbers and confirm the header looks valid."}],"resultDescription":"Returns a structured object containing the PDF major and minor version numbers, the version string, header offset (bytes before %PDF-), whether the version is valid, whether a binary marker is present, the number of bytes examined, a verdict (valid/invalid), a summary, and a list of reasons for any flags raised.","failureModes":["Hex string is too short to contain a recognizable PDF header — partial or missing data returned","Non-hex characters in the hex query parameter — malformed input error","File bytes do not contain %PDF- at all — invalid verdict with reasons","Version string present but unrecognized — validVersion returned as false","Service unavailable or payment not processed — HTTP 402 or 5xx error"],"whenToPreferThis":"Choose this endpoint when you need to quickly inspect the first bytes of a PDF to verify its header structure, determine the PDF specification version, or detect whether junk bytes precede the %PDF- marker — without fully parsing or rendering the document. Ideal for file upload validation pipelines, forensic document triage, or pre-processing checks before passing files to a PDF parser.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:15:03.711Z","isFirstParty":false,"canonicalSlug":"pdf-header-inspector-441781ff"}