{"uid":"cap_dQAuvOlQ1fHfBqSLYZFsb","slug":"tanod-docs-html-to-pdf-a0b6c377","name":"Tanod Docs HTML to PDF","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/html-to-pdf?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"minLength":1,"description":"Public http(s) URL of the page to print."},"paper":{"enum":["a4","letter","legal","a3","a5","tabloid"],"type":"string","default":"a4","description":"Paper size: a4 (default), letter, legal, a3, a5 or tabloid."},"scale":{"type":"number","default":1,"maximum":2,"minimum":0.1,"description":"Print scale of the page content (0.1-2.0, default 1.0)."},"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."},"wait_ms":{"type":"integer","default":500,"maximum":5000,"minimum":0,"description":"Extra settle time after the load event."},"landscape":{"type":"boolean","default":false,"description":"Landscape orientation (default false: portrait)."},"margin_mm":{"type":"object","properties":{"top":{"type":"number","default":10,"maximum":50,"minimum":0},"left":{"type":"number","default":10,"maximum":50,"minimum":0},"right":{"type":"number","default":10,"maximum":50,"minimum":0},"bottom":{"type":"number","default":10,"maximum":50,"minimum":0}},"description":"Margins in mm (0-50 each, default 10).","additionalProperties":false},"print_background":{"type":"boolean","default":true,"description":"Print background colours and images (default true)."}}},"responseSchema":{"type":"json","example":{"url":"https://example.com","file":{"name":"page.pdf","bytes":27621,"pages":1,"data_base64":"JVBERi0xLjQKJdPr... (trimmed: 36,828 base64 characters in the reply)","content_type":"application/pdf"},"pages":1,"paper":"a4","landscape":false,"operation":"html-to-pdf","output_bytes":27621,"untrusted_content":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0045","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.0045/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0045","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0045","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_BYceRq0Ex7kgOrPw-rfmL","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0045","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a public web page URL to a PDF file, with configurable paper size, orientation, margins, scale, and background rendering.","exampleAgentPrompt":"Can you convert https://en.wikipedia.org/wiki/PDF to a PDF for me — use A4 paper in portrait orientation, with 15mm margins on all sides, and give me a download link rather than the raw base64?","exampleUseCases":[{"title":"Archive a web article as PDF","prompt":"Save this article as a PDF so I can read it offline later — here's the URL: https://www.theverge.com/2024/5/1/example-article. Use letter-size paper and make sure the background colors are included."},{"title":"Generate printable report from dashboard","prompt":"Print this internal dashboard page to PDF for the board meeting: https://reports.mycompany.com/q1-2024. Use A4 landscape orientation with 5mm margins and wait 2000ms for the charts to fully load."},{"title":"Export invoice page for accounting","prompt":"I need a PDF copy of this invoice page at https://billing.stripe.com/invoice/example123 — A4 size, portrait, default margins, and return a download link that I can share with the accounting team."}],"resultDescription":"Returns a JSON object containing the PDF as either a base64-encoded string (inline) or a temporary download URL valid for 24 hours. Also includes metadata: file name, byte size, page count, paper size, landscape flag, content type, and a SHA256 hash. The response also echoes the source URL and operation name.","failureModes":["URL is not publicly accessible (private, behind auth, or firewall) — conversion may fail or produce empty/incomplete output","URL returns non-HTML content (e.g. raw binary) — output PDF may be malformed","wait_ms too low for JavaScript-heavy pages — charts or dynamic content may not render","Page requires authentication — rendered PDF will show login page instead of content","Invalid or unreachable URL — 4xx/5xx error response","Scale or margin values out of allowed range — validation error"],"whenToPreferThis":"Choose this endpoint when you need to convert a live, publicly accessible web page or HTML URL into a PDF with precise control over paper size, orientation, margins, scale, and background rendering. It is ideal for archiving articles, generating printable reports from web dashboards, or exporting invoices and receipts from public URLs. Prefer the URL output mode when the PDF is large to avoid bloating the context window with base64 data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T12:45:55.681Z","isFirstParty":false,"canonicalSlug":"tanod-docs-html-to-pdf-a0b6c377"}