[{"data":1,"prerenderedAt":143},["Reactive",2],{"/guides/curl/convert-html-to-pdf-from-a-url/":3,"related:JKX4HG9Zkq":61},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"language":10,"library":10,"property":11,"output":12,"related":13,"default":16,"body":17,"_type":56,"_id":57,"_source":58,"_file":59,"_extension":60},"/guides/curl/convert-html-to-pdf-from-a-url","curl",false,"","Convert an HTML document to PDF from a URL","Learn how to easily convert HTML documents to PDF from a URL using cUrl. This how-to guide offers clear cUrl code examples that show developers how to implement this using the PDFShift API.","cUrl","source","pdf",[14,15],"convert-html-to-pdf-from-raw-html","avoid-conversion-on-error",true,{"type":18,"children":19,"toc":53},"root",[20,28,41,46],{"type":21,"tag":22,"props":23,"children":24},"element","p",{},[25],{"type":26,"value":27},"text","In this guide, we'll show you how to convert HTML documents to PDFs using PDFShift's API. This is a straightforward process that can be accomplished with just a few lines of cUrl code.",{"type":21,"tag":29,"props":30,"children":35},"pre",{"code":31,"language":32,"meta":7,"className":33},"# You can get an API key at https://pdfshift.io\nAPI_KEY=\"sk_xxxxxxxxxxxx\"\n\n# Convert HTML from a URL to PDF\ncurl -X POST \"https://api.pdfshift.io/v3/convert/pdf\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: ${API_KEY}\" \\\n  -d '{\"source\": \"https://www.example.com\"}' \\\n  -o \"result.pdf\"\n","bash",[34],"language-bash",[36],{"type":21,"tag":37,"props":38,"children":39},"code",{"__ignoreMap":7},[40],{"type":26,"value":31},{"type":21,"tag":22,"props":42,"children":43},{},[44],{"type":26,"value":45},"With this cUrl command, you can convert HTML documents from a URL to PDF files using PDFShift's API. Happy coding!",{"type":21,"tag":29,"props":47,"children":48},{"code":7},[49],{"type":21,"tag":37,"props":50,"children":51},{"__ignoreMap":7},[52],{"type":26,"value":7},{"title":7,"searchDepth":54,"depth":54,"links":55},2,[],"markdown","content:guides:curl:convert-html-to-pdf-from-a-url.md","content","guides/curl/convert-html-to-pdf-from-a-url.md","md",[62,66,70,74,78,82,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139],{"_path":63,"title":64,"language":10,"library":10,"_id":65},"/guides/curl/accessing-secured-pages","Accessing secured pages","content:guides:curl:accessing-secured-pages.md",{"_path":67,"title":68,"language":10,"library":10,"_id":69},"/guides/curl/adding-a-custom-header-or-footer","Adding a custom header or footer","content:guides:curl:adding-a-custom-header-or-footer.md",{"_path":71,"title":72,"language":10,"library":10,"_id":73},"/guides/curl/adding-a-text-watermark","Adding a text watermark","content:guides:curl:adding-a-text-watermark.md",{"_path":75,"title":76,"language":10,"library":10,"_id":77},"/guides/curl/adding-an-image-watermark","Adding an image watermark","content:guides:curl:adding-an-image-watermark.md",{"_path":79,"title":80,"language":10,"library":10,"_id":81},"/guides/curl/avoid-conversion-on-error","Avoid conversion on error","content:guides:curl:avoid-conversion-on-error.md",{"_path":4,"title":8,"language":10,"library":10,"_id":57},{"_path":84,"title":85,"language":10,"library":10,"_id":86},"/guides/curl/convert-html-to-pdf-from-raw-html","Convert an HTML document to PDF from raw HTML","content:guides:curl:convert-html-to-pdf-from-raw-html.md",{"_path":88,"title":89,"language":10,"library":10,"_id":90},"/guides/curl/define-a-time-limit","Define a time limit","content:guides:curl:define-a-time-limit.md",{"_path":92,"title":93,"language":10,"library":10,"_id":94},"/guides/curl/exporting-only-a-specific-set-of-pages","Exporting only a specific set of pages","content:guides:curl:exporting-only-a-specific-set-of-pages.md",{"_path":96,"title":97,"language":10,"library":10,"_id":98},"/guides/curl/generate-a-document-with-full-height","Generate a document with full height","content:guides:curl:generate-a-document-with-full-height.md",{"_path":100,"title":101,"language":10,"library":10,"_id":102},"/guides/curl/loading-css-from-a-string","Loading CSS from a string","content:guides:curl:loading-css-from-a-string.md",{"_path":104,"title":105,"language":10,"library":10,"_id":106},"/guides/curl/loading-css-from-a-url","Loading CSS from a URL","content:guides:curl:loading-css-from-a-url.md",{"_path":108,"title":109,"language":10,"library":10,"_id":110},"/guides/curl/loading-javascript-from-a-string","Loading JavaScript from a string","content:guides:curl:loading-javascript-from-a-string.md",{"_path":112,"title":113,"language":10,"library":10,"_id":114},"/guides/curl/loading-javascript-from-a-url","Loading JavaScript from a URL","content:guides:curl:loading-javascript-from-a-url.md",{"_path":116,"title":117,"language":10,"library":10,"_id":118},"/guides/curl/protecting-the-generated-pdf","Protecting the generated PDF","content:guides:curl:protecting-the-generated-pdf.md",{"_path":120,"title":121,"language":10,"library":10,"_id":122},"/guides/curl/receive-a-webhook-event","Receive a webhook event","content:guides:curl:receive-a-webhook-event.md",{"_path":124,"title":125,"language":10,"library":10,"_id":126},"/guides/curl/save-your-pdf-online-and-get-back-a-url","Save your PDF online and get back a URL","content:guides:curl:save-your-pdf-online-and-get-back-a-url.md",{"_path":128,"title":129,"language":10,"library":10,"_id":130},"/guides/curl/save-your-pdf-to-your-amazon-s3-bucket","Save your PDF to your Amazon S3 bucket","content:guides:curl:save-your-pdf-to-your-amazon-s3-bucket.md",{"_path":132,"title":133,"language":10,"library":10,"_id":134},"/guides/curl/send-custom-http-headers","Send custom HTTP headers","content:guides:curl:send-custom-http-headers.md",{"_path":136,"title":137,"language":10,"library":10,"_id":138},"/guides/curl/using-cookies","Using cookies","content:guides:curl:using-cookies.md",{"_path":140,"title":141,"language":10,"library":10,"_id":142},"/guides/curl/waiting-for-a-custom-element-to-be-ready","Waiting for a custom element to be ready","content:guides:curl:waiting-for-a-custom-element-to-be-ready.md",1796403672345]