{"uid":"cap_-PFZ6lZDqx6U2lClGCtRi","slug":"tanod-docs-pdf-repair-6c2b1a09","name":"Tanod Docs PDF Repair","description":"Documents: DOCX template fill, Office to PDF, any file to Markdown, PDF to Word, OCR, PDF pipeline.","url":"https://docs.tanod.dev/v1/pdf/repair?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"url":{"anyOf":[{"type":"string","maxLength":2048,"minLength":1},{"type":"null"}],"default":null,"description":"Public http(s) URL of the PDF (at most 20 MB; private, internal and IP-literal hosts are refused); or use pdf_base64."},"output":{"enum":["base64","url"],"type":"string","default":"base64","description":"base64 (default): the file comes back inline as base64. url: the file is stored for 24 hours and the reply carries a download link (url, expires_at, bytes, content_type, sha256) instead of the base64, which keeps the file out of your context window."},"linearize":{"type":"boolean","default":false,"description":"Also write the file for fast web view (linearized; default false)."},"pdf_base64":{"anyOf":[{"type":"string","maxLength":13398872,"minLength":1},{"type":"null"}],"default":null,"description":"The PDF as base64 (at most 10 MB decoded per request); or use url."}}},"responseSchema":{"type":"json","example":{"file":{"name":"repaired.pdf","bytes":13730,"pages":1,"data_base64":"JVBERi0xLjQKJb/3... (trimmed: 18,308 base64 characters in the reply)","content_type":"application/pdf"},"repaired":false,"warnings":[],"operation":"repair","linearized":true,"bytes_after":13730,"input_bytes":13264,"input_pages":1,"bytes_before":13264,"output_bytes":13730,"reconstructed":false,"warning_count":0,"untrusted_content":true,"active_content_removed":{}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Cwkj3M_GkDqqgv1V1eH9S","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Repairs and sanitizes a corrupt or malformed PDF, optionally linearizing it for fast web view, and returns the fixed file as base64 or a download URL.","exampleAgentPrompt":"This PDF is corrupted and won't open properly — can you repair it and send back the fixed version as a download link rather than inline data?","exampleUseCases":[{"title":"Sanitize untrusted PDF uploads","prompt":"A user just uploaded a PDF to our platform and I'm not sure it's safe — can you repair and sanitize it to strip out any active content or scripts before we store it? Return it as a download URL."},{"title":"Fix corrupt PDF before OCR","prompt":"I have a PDF that's throwing errors when I try to run OCR on it — please repair it first so it's a valid, clean file, and give me back the fixed version as base64."},{"title":"Linearize PDF for fast web preview","prompt":"We need to serve this PDF in a browser viewer with fast page load — can you repair it and also linearize it for fast web view, then give me a download link?"}],"resultDescription":"Returns a JSON object with the repaired PDF file (name, byte count, page count, content type, and data as base64 or a 24-hour download URL), a boolean indicating whether repair was performed, a reconstructed flag, a list of warnings, counts of bytes before and after, and a report of any active content removed.","failureModes":["PDF URL is private, internal, or IP-literal — returns error refusing the URL","PDF exceeds 20 MB via URL or 10 MB via base64 — returns size limit error","Neither url nor pdf_base64 provided — returns validation error","PDF is so severely corrupted it cannot be reconstructed — may return error or reconstructed:false","Network fetch of the provided URL fails or times out — returns fetch error"],"whenToPreferThis":"Use this endpoint when you need to fix a corrupt, malformed, or potentially unsafe PDF before further processing (OCR, conversion, storage, or display). It is also the right choice when you need to linearize a PDF for fast browser streaming, or sanitize a PDF by removing active/scripted content. Prefer it over generic conversion endpoints when the input is already a PDF and the goal is healing or hardening it rather than format conversion.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T12:45:00.707Z","isFirstParty":false,"canonicalSlug":"tanod-docs-pdf-repair-6c2b1a09"}