{"uid":"cap_QMlSNa4iRjMWWk_m1Kg4O","slug":"boring-api-convert-html-to-pdf-32c541c6","name":"boring-api · convert: HTML to PDF","description":"Document and data format conversions via Pandoc, Chromium-headless, and pure-JS libs. Text inputs/outputs are JSON-fielded; binary inputs/outputs use base64 in JSON for uniformity.","url":"https://convert.boring-api.com/html-to-pdf","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"format":{"enum":["A4","Letter","Legal"],"type":"string"},"content":{"type":"string"},"landscape":{"type":"boolean"}}},"responseSchema":{"type":"object"},"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_3xagqtlD5GXVhT3yqWbqM","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":"Converts HTML content to a PDF document using Chromium headless, returning the PDF as base64-encoded binary in JSON.","exampleAgentPrompt":"Convert this HTML into a PDF for me — here's the markup: '<h1>Invoice #42</h1><p>Total: $500</p>' — and make it landscape orientation.","exampleUseCases":null,"resultDescription":"A JSON object containing the resulting PDF as a base64-encoded binary string, suitable for decoding and saving as a .pdf file.","failureModes":["Invalid or malformed HTML content causing rendering failure","Unsupported format value resulting in an error response","Payment failure (402) if x402 payment header is missing or insufficient","Base64 decoding errors if the output is not properly handled","Timeout if the HTML content is extremely large or complex","Missing required 'content' field returns a validation error"],"whenToPreferThis":"Choose this endpoint when you need to programmatically convert raw HTML markup into a PDF document, especially when you want Chromium-accurate rendering (CSS, layout, fonts) and need the result as base64 JSON. Prefer this over Pandoc-based conversion endpoints when visual fidelity to the browser rendering matters. Ideal for generating invoices, reports, or styled documents from HTML templates.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:41:50.377Z","isFirstParty":false}