{"uid":"cap_qBkUz2HdpcNA65fwoZhfk","slug":"tanod-docs-pdf-resize-fa2e2f67","name":"Tanod Docs PDF Resize","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/resize?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."},"mode":{"enum":["fit","fill","stretch"],"type":"string","default":"fit","description":"fit (default): the whole page inside the new one, centred, aspect ratio kept; fill: the new page covered, aspect ratio kept, the overflow cut off; stretch: the page forced to the new size."},"size":{"enum":["a4","letter","legal","custom"],"type":"string","description":"a4 (595.28 x 841.89 pt), letter (612 x 792), legal (612 x 1008) or custom (then width and height)."},"unit":{"enum":["pt","mm","in"],"type":"string","default":"pt","description":"Unit of width and height: pt (default), mm or in."},"pages":{"anyOf":[{"type":"string","pattern":"^[0-9a-zA-Z ,\\-]+$","maxLength":200,"minLength":1},{"type":"null"}],"default":null,"description":"Pages to resize (default all), e.g. 1-3,5."},"width":{"anyOf":[{"type":"number","maximum":1000000,"exclusiveMinimum":0},{"type":"null"}],"default":null,"description":"size=custom: one side of the page, in `unit`."},"height":{"anyOf":[{"type":"number","maximum":1000000,"exclusiveMinimum":0},{"type":"null"}],"default":null,"description":"size=custom: the other side, in `unit` (each side 36 to 14,400 pt)."},"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."},"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."},"orientation":{"enum":["auto","portrait","landscape"],"type":"string","default":"auto","description":"auto (default): each page keeps its orientation; or force portrait or landscape (the longer side of the size is vertical or horizontal)."}}},"responseSchema":{"type":"json","example":{"file":{"name":"resized.pdf","bytes":90065,"pages":6,"data_base64":"JVBERi0xLjcKJb/3... (trimmed: 120,088 base64 characters in the reply)","content_type":"application/pdf"},"mode":"fit","size":"a4","sizes":[{"page":1,"scale":0.9727,"width_pt":595.28,"height_pt":841.89},{"page":2,"scale":0.9727,"width_pt":595.28,"height_pt":841.89}],"operation":"resize","input_bytes":140815,"input_pages":6,"output_bytes":90065,"resized_pages":2,"sizes_truncated":false,"untrusted_content":true,"active_content_removed":{"xfa":1,"javascript":1}}},"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_axKvsprlN-pLscFBhI5jO","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":"Resizes pages of a PDF to a target paper size (A4, Letter, Legal, or custom dimensions) using fit, fill, or stretch modes.","exampleAgentPrompt":"Can you resize all pages of this PDF (https://example.com/report.pdf) to A4 size using fit mode, keeping the aspect ratio, and give me back a download link?","exampleUseCases":[{"title":"Standardize vendor invoices to A4","prompt":"I have a bunch of supplier invoices as PDFs in US letter format — can you resize them all to A4 using fit mode so they print correctly in our European office? Here's the first one: https://example.com/invoice.pdf"},{"title":"Prepare legal-size document for court filing","prompt":"This contract PDF needs to be in legal page size for filing — please resize it to legal format using stretch mode and send me back the file as base64."},{"title":"Resize custom-dimension brochure pages","prompt":"I need pages 1-4 of this brochure PDF resized to exactly 210mm wide by 297mm tall in fill mode — can you do that and give me a download link? Here's the PDF: https://example.com/brochure.pdf"}],"resultDescription":"Returns a JSON object containing the resized PDF (as base64 data or a 24-hour download URL), the output file name, byte size, page count, per-page scale factors and final dimensions in points, the resize mode and target size used, input/output byte counts, number of pages resized, and a report of any active content (XFA forms, JavaScript) removed for security.","failureModes":["PDF URL is inaccessible, private, or exceeds 20 MB — returns error refusing the URL","Base64-encoded PDF exceeds 10 MB decoded limit — returns payload too large error","Invalid page range string (e.g. non-numeric characters) — returns validation error","Custom size specified without providing both width and height — returns missing parameter error","Unsupported or corrupt PDF file — returns processing error","Width or height outside allowed bounds (36–14,400 pt) — returns validation error"],"whenToPreferThis":"Choose this endpoint when you need to change the physical page dimensions of a PDF — standardizing to A4, Letter, or Legal for printing or filing, or fitting content into custom dimensions. It preserves document integrity, supports selective page ranges, and sanitizes active content (JavaScript, XFA). Prefer it over generic PDF converters when you need per-page scale metadata, flexible unit input (pt/mm/in), or a lightweight download-URL output to avoid large base64 payloads in your context window.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T12:44:37.500Z","isFirstParty":false,"canonicalSlug":"tanod-docs-pdf-resize-fa2e2f67"}