[{"data":1,"prerenderedAt":578},["Reactive",2],{"/tools/url-to-pdf":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"seoTitle":10,"lead":11,"date":12,"dateModified":12,"author":13,"faq":14,"body":24,"_type":573,"_id":574,"_source":575,"_file":576,"_extension":577},"/tools/url-to-pdf","tools",false,"","Convert a webpage to PDF","Paste a web address and get it back as a PDF, made by PDFShift's Chromium. Pick the page size and the print stylesheet, then copy the same request as an API call.","Convert a Webpage to PDF: Free URL to PDF Tool | PDFShift","Paste a web address and get it back as a PDF.","2026-11-22","Cyril Nicodème",[15,18,21],{"question":16,"answer":17},"How do I get a PDF of an entire webpage?","Convert it here. PDFShift prints the whole page, top to bottom, across as many PDF pages as it takes: 22 for Wikipedia's article on PDF. If images further down come out blank, tick Load lazy images.",{"question":19,"answer":20},"How do I turn a URL link into a PDF from my code?","Send the address as the source of one POST to api.pdfshift.io/v3/convert/pdf, with your API key in the X-API-Key header, and the PDF comes back in the response. Our guides show the call in Python, Node, PHP and other languages.",{"question":22,"answer":23},"Can I convert a page that needs a login?","Yes, from your own code. The API can send cookies, HTTP headers or a basic auth username and password with the request that loads the page, and our guide on loading pages behind a login shows how. The converter here sends none of them.",{"type":25,"children":26,"toc":559},"root",[27,35,42,47,53,58,148,154,176,205,210,216,221,433,438,444,449,461,483,489,495,499,504,541,546],{"type":28,"tag":29,"props":30,"children":31},"element","p",{},[32],{"type":33,"value":34},"text","Type the address, pick the page size and convert. Our Chromium opens the page and sends the PDF back. If the site's menus and buttons come along, tick Print stylesheet and convert again: most sites hide them on paper. Once it looks right, the API call tab has the same request, ready for your code.",{"type":28,"tag":36,"props":37,"children":39},"h2",{"id":38},"when-the-pdf-has-to-come-from-a-server",[40],{"type":33,"value":41},"When the PDF has to come from a server",{"type":28,"tag":29,"props":43,"children":44},{},[45],{"type":33,"value":46},"Ctrl+P and Save as PDF handle the page in front of you. They don't handle the invoice your app sends at 3 a.m., the report a customer downloads, or a hundred URLs nobody wants to print by hand. Those need a browser on a server, and that's what you're using here: you send an address, our Chromium prints it, you get a file back. People don't buy PDFs. They buy not having to run Chromium.",{"type":28,"tag":36,"props":48,"children":50},{"id":49},"why-the-pdf-doesnt-look-like-the-page",[51],{"type":33,"value":52},"Why the PDF doesn't look like the page",{"type":28,"tag":29,"props":54,"children":55},{},[56],{"type":33,"value":57},"PDFShift loads the address from our servers as a first-time visitor, then prints it.",{"type":28,"tag":59,"props":60,"children":61},"ul",{},[62,92,110,128,138],{"type":28,"tag":63,"props":64,"children":65},"li",{},[66,72,74,81,83,90],{"type":28,"tag":67,"props":68,"children":69},"strong",{},[70],{"type":33,"value":71},"Menus and buttons in the PDF.",{"type":33,"value":73}," That's the screen version, which PDFShift prints by default. ",{"type":28,"tag":75,"props":76,"children":78},"code",{"className":77},[],[79],{"type":33,"value":80},"use_print",{"type":33,"value":82}," (Print stylesheet above) switches to the styles the site wrote for paper. If you write those styles yourself, the ",{"type":28,"tag":84,"props":85,"children":87},"a",{"href":86},"/tools/html-viewer/",[88],{"type":33,"value":89},"HTML viewer",{"type":33,"value":91}," shows what they change before you convert.",{"type":28,"tag":63,"props":93,"children":94},{},[95,100,102,108],{"type":28,"tag":67,"props":96,"children":97},{},[98],{"type":33,"value":99},"Images missing further down.",{"type":33,"value":101}," Many pages only load an image when you scroll near it. ",{"type":28,"tag":75,"props":103,"children":105},{"className":104},[],[106],{"type":33,"value":107},"lazy_load_images",{"type":33,"value":109}," scrolls to the bottom first, so they're all there when it prints.",{"type":28,"tag":63,"props":111,"children":112},{},[113,118,120,126],{"type":28,"tag":67,"props":114,"children":115},{},[116],{"type":33,"value":117},"Content that loads late.",{"type":33,"value":119}," PDFShift waits until no request has gone out for 500 ms before printing. A chart that draws after that can still be missed. In the API, ",{"type":28,"tag":75,"props":121,"children":123},{"className":122},[],[124],{"type":33,"value":125},"delay",{"type":33,"value":127}," makes PDFShift wait up to 10 seconds longer.",{"type":28,"tag":63,"props":129,"children":130},{},[131,136],{"type":28,"tag":67,"props":132,"children":133},{},[134],{"type":33,"value":135},"A cookie banner or a login screen.",{"type":33,"value":137}," The page loads with no cookies and no session, so you get what a signed-out stranger gets.",{"type":28,"tag":63,"props":139,"children":140},{},[141,146],{"type":28,"tag":67,"props":142,"children":143},{},[144],{"type":33,"value":145},"The wrong page size.",{"type":33,"value":147}," A4 is the default. Letter and Legal are one click above, and the API takes other sizes too.",{"type":28,"tag":36,"props":149,"children":151},{"id":150},"a-real-example-wikipedias-pdf-article",[152],{"type":33,"value":153},"A real example: Wikipedia's PDF article",{"type":28,"tag":29,"props":155,"children":156},{},[157,159,167,169,174],{"type":33,"value":158},"We converted ",{"type":28,"tag":84,"props":160,"children":164},{"href":161,"rel":162},"https://en.wikipedia.org/wiki/PDF",[163],"nofollow",[165],{"type":33,"value":166},"Wikipedia's article on PDF",{"type":33,"value":168}," twice on November 22, 2026, once with the defaults and once with Print stylesheet. By default, page 1 opens with the site's menus: Donate, Create account, Log in, 96 languages, Talk, Read, Edit, View history. With ",{"type":28,"tag":75,"props":170,"children":172},{"className":171},[],[173],{"type":33,"value":80},{"type":33,"value":175},", page 1 opens on the article itself, and the whole PDF drops from 22 pages and 1.14 MB to 21 pages and 0.92 MB.",{"type":28,"tag":177,"props":178,"children":180},"guide-figure",{"caption":179},"Page 1 of the same Wikipedia article, converted by PDFShift without and with use_print. The badge top right is the watermark on conversions without an API key.",[181],{"type":28,"tag":182,"props":183,"children":185},"guide-page-pair",{":names":184},"[\"Defaults\", \"Print stylesheet (use_print)\"]",[186,197],{"type":28,"tag":29,"props":187,"children":188},{},[189],{"type":28,"tag":190,"props":191,"children":196},"img",{"alt":192,"height":193,"src":194,"width":195},"The Wikipedia PDF article converted with PDFShift's defaults. On page 1, the site's menu bar with Donate, Create account and Log in runs across the top, followed by the Article and Talk tabs, 96 languages and Read, Edit, View history, before the article text and the infobox.",843,"/images/tools/url-to-pdf/wikipedia-pdf-default.webp",596,[],{"type":28,"tag":29,"props":198,"children":199},{},[200],{"type":28,"tag":190,"props":201,"children":204},{"alt":202,"height":193,"src":203,"width":195},"The same article converted with use_print. Page 1 starts with the Wikipedia logo and the article title, then the lead paragraph and the infobox, with no menus or tabs.","/images/tools/url-to-pdf/wikipedia-pdf-use-print.webp",[],{"type":28,"tag":29,"props":206,"children":207},{},[208],{"type":33,"value":209},"Load lazy images changed nothing on this one: same 22 pages as the defaults.",{"type":28,"tag":36,"props":211,"children":213},{"id":212},"how-the-converter-works",[214],{"type":33,"value":215},"How the converter works",{"type":28,"tag":29,"props":217,"children":218},{},[219],{"type":33,"value":220},"Your browser sends the address and your settings straight to the PDFShift API, the same endpoint your code would call, just without a key. Our Chromium loads the page, prints it at your page size and returns the PDF in the response. We don't keep a copy.",{"type":28,"tag":177,"props":222,"children":224},{"caption":223},"Each setting in the converter is one API parameter. A4 is the default, so it isn't sent.",[225],{"type":28,"tag":226,"props":227,"children":235},"svg",{"viewBox":228,"xmlns":229,"role":190,"ariaLabelledBy":230,"style":233,"fontFamily":234},"0 0 560 240","http://www.w3.org/2000/svg",[231,232],"u2p-req-title","u2p-req-desc","max-width:560px;min-width:420px;display:block;margin:0 auto","DM Sans, sans-serif",[236,242,248,257,361,368,373,377],{"type":28,"tag":237,"props":238,"children":239},"title",{"id":231},[240],{"type":33,"value":241},"The converter's settings become the request body",{"type":28,"tag":243,"props":244,"children":245},"desc",{"id":232},[246],{"type":33,"value":247},"On the left, the converter with the address https://en.wikipedia.org/wiki/PDF, page size A4 and Print stylesheet ticked. An arrow points to the request body on the right: source set to the address and use_print set to true. Below it, the result: a PDF of 21 pages, 0.92 MB.",{"type":28,"tag":249,"props":250,"children":256},"rect",{"x":251,"y":251,"width":252,"height":253,"rx":251,"fill":254,"stroke":255},"10","240","220","#FFFFFF","#C6B2FF",[],{"type":28,"tag":258,"props":259,"children":262},"g",{"fill":260,"style":261},"#0A0C3D","font-size:13px",[263,271,280,287,293,301,308,314,320,326,333,340,345,351,355],{"type":28,"tag":33,"props":264,"children":268},{"x":265,"y":266,"style":267},"26","36","font-weight:700",[269],{"type":33,"value":270},"Web address",{"type":28,"tag":249,"props":272,"children":279},{"x":265,"y":273,"width":274,"height":275,"rx":276,"fill":277,"stroke":278},"46","208","28","6","#F3EFFF","#DBE4F2",[],{"type":28,"tag":33,"props":281,"children":284},{"x":266,"y":282,"style":283},"65","font-size:12px",[285],{"type":33,"value":286},"en.wikipedia.org/wiki/PDF",{"type":28,"tag":33,"props":288,"children":290},{"x":265,"y":289,"style":267},"98",[291],{"type":33,"value":292},"Page size",{"type":28,"tag":249,"props":294,"children":300},{"x":265,"y":295,"width":296,"height":297,"rx":298,"fill":299},"106","40","24","5","#6C47FF",[],{"type":28,"tag":33,"props":302,"children":305},{"x":273,"y":303,"fill":254,"style":304},"122","font-size:12px;text-anchor:middle",[306],{"type":33,"value":307},"A4",{"type":28,"tag":33,"props":309,"children":311},{"x":310,"y":303,"style":304},"88",[312],{"type":33,"value":313},"Letter",{"type":28,"tag":33,"props":315,"children":317},{"x":316,"y":303,"style":304},"134",[318],{"type":33,"value":319},"Legal",{"type":28,"tag":249,"props":321,"children":325},{"x":265,"y":322,"width":323,"height":323,"rx":324,"fill":299},"146","14","3",[],{"type":28,"tag":327,"props":328,"children":332},"polyline",{"points":329,"fill":330,"stroke":254,"style":331},"29,153 32,157 37,149","none","stroke-width:2",[],{"type":28,"tag":33,"props":334,"children":337},{"x":335,"y":336},"48","158",[338],{"type":33,"value":339},"Print stylesheet",{"type":28,"tag":249,"props":341,"children":344},{"x":265,"y":342,"width":323,"height":323,"rx":324,"fill":254,"stroke":343},"172","#4C556D",[],{"type":28,"tag":33,"props":346,"children":348},{"x":335,"y":347},"184",[349],{"type":33,"value":350},"Landscape",{"type":28,"tag":249,"props":352,"children":354},{"x":265,"y":353,"width":323,"height":323,"rx":324,"fill":254,"stroke":343},"198",[],{"type":28,"tag":33,"props":356,"children":358},{"x":335,"y":357},"210",[359],{"type":33,"value":360},"Load lazy images",{"type":28,"tag":362,"props":363,"children":367},"line",{"x1":364,"y1":365,"x2":366,"y2":365,"stroke":343,"style":331},"256","110","296",[],{"type":28,"tag":369,"props":370,"children":372},"polygon",{"points":371,"fill":343},"296,104 306,110 296,116",[],{"type":28,"tag":249,"props":374,"children":376},{"x":375,"y":251,"width":252,"height":253,"rx":251,"fill":260},"310",[],{"type":28,"tag":258,"props":378,"children":380},{"fill":254,"style":379},"font-size:12px;font-family:Source Code Pro, monospace",[381,388,394,401,409,415,421,427],{"type":28,"tag":33,"props":382,"children":385},{"x":383,"y":266,"style":384},"326","font-size:13px;font-weight:700;font-family:DM Sans, sans-serif",[386],{"type":33,"value":387},"Request body",{"type":28,"tag":33,"props":389,"children":391},{"x":383,"y":390},"64",[392],{"type":33,"value":393},"{",{"type":28,"tag":33,"props":395,"children":398},{"x":396,"y":397},"340","84",[399],{"type":33,"value":400},"\"source\":",{"type":28,"tag":33,"props":402,"children":406},{"x":403,"y":404,"fill":405},"354","102","#b2ffc3",[407],{"type":33,"value":408},"\"https://en.wikipedia",{"type":28,"tag":33,"props":410,"children":412},{"x":403,"y":411,"fill":405},"120",[413],{"type":33,"value":414},".org/wiki/PDF\",",{"type":28,"tag":33,"props":416,"children":418},{"x":396,"y":417},"140",[419],{"type":33,"value":420},"\"use_print\": true",{"type":28,"tag":33,"props":422,"children":424},{"x":383,"y":423},"160",[425],{"type":33,"value":426},"}",{"type":28,"tag":33,"props":428,"children":430},{"x":383,"y":274,"style":429},"font-size:13px;font-family:DM Sans, sans-serif",[431],{"type":33,"value":432},"PDF: 21 pages, 0.92 MB",{"type":28,"tag":29,"props":434,"children":435},{},[436],{"type":33,"value":437},"Without a key, PDFShift treats the request as a free account: the PDF carries the \"Created via PDFShift\" badge, files over 2 MB can't be made, conversions time out after 30 seconds, and you get up to 10 conversions a day. Addresses on your own network, like localhost, are refused.",{"type":28,"tag":36,"props":439,"children":441},{"id":440},"the-same-pdf-from-your-code",[442],{"type":33,"value":443},"The same PDF from your code",{"type":28,"tag":29,"props":445,"children":446},{},[447],{"type":33,"value":448},"Here's what the API call tab gives you for the Wikipedia example with Print stylesheet ticked:",{"type":28,"tag":450,"props":451,"children":456},"pre",{"className":452,"code":454,"language":455,"meta":7},[453],"language-bash","curl https://api.pdfshift.io/v3/convert/pdf \\\n  -H \"X-API-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"source\":\"https://en.wikipedia.org/wiki/PDF\",\"use_print\":true}' \\\n  -o page.pdf\n","bash",[457],{"type":28,"tag":75,"props":458,"children":459},{"__ignoreMap":7},[460],{"type":33,"value":454},{"type":28,"tag":29,"props":462,"children":463},{},[464,466,473,475,481],{"type":33,"value":465},"Swap in your key and that's your integration. Every parameter is in the ",{"type":28,"tag":84,"props":467,"children":470},{"href":468,"rel":469},"https://docs.pdfshift.io/api-reference/convert-to-pdf",[163],[471],{"type":33,"value":472},"API reference",{"type":33,"value":474},". The free plan gives you 50 credits a month with no credit card: ",{"type":28,"tag":84,"props":476,"children":478},{"href":477},"/register/",[479],{"type":33,"value":480},"create an account",{"type":33,"value":482}," to get your key.",{"type":28,"tag":36,"props":484,"children":486},{"id":485},"frequently-asked-questions",[487],{"type":33,"value":488},"Frequently asked questions",{"type":28,"tag":490,"props":491,"children":493},"h3",{"id":492},"how-do-i-get-a-pdf-of-an-entire-webpage",[494],{"type":33,"value":16},{"type":28,"tag":29,"props":496,"children":497},{},[498],{"type":33,"value":17},{"type":28,"tag":490,"props":500,"children":502},{"id":501},"how-do-i-turn-a-url-link-into-a-pdf-from-my-code",[503],{"type":33,"value":19},{"type":28,"tag":29,"props":505,"children":506},{},[507,509,515,517,523,525,531,533,539],{"type":33,"value":508},"Send the address as the ",{"type":28,"tag":75,"props":510,"children":512},{"className":511},[],[513],{"type":33,"value":514},"source",{"type":33,"value":516}," of one POST to ",{"type":28,"tag":75,"props":518,"children":520},{"className":519},[],[521],{"type":33,"value":522},"api.pdfshift.io/v3/convert/pdf",{"type":33,"value":524},", with your API key in the ",{"type":28,"tag":75,"props":526,"children":528},{"className":527},[],[529],{"type":33,"value":530},"X-API-Key",{"type":33,"value":532}," header, and the PDF comes back in the response. Our guides show ",{"type":28,"tag":84,"props":534,"children":536},{"href":535},"/guides/python/requests/convert-html-to-pdf-from-a-url/",[537],{"type":33,"value":538},"the call in Python",{"type":33,"value":540},", Node, PHP and other languages.",{"type":28,"tag":490,"props":542,"children":544},{"id":543},"can-i-convert-a-page-that-needs-a-login",[545],{"type":33,"value":22},{"type":28,"tag":29,"props":547,"children":548},{},[549,551,557],{"type":33,"value":550},"Yes, from your own code. The API can send cookies, HTTP headers or a basic auth username and password with the request that loads the page, and our guide on ",{"type":28,"tag":84,"props":552,"children":554},{"href":553},"/guides/curl/accessing-secured-pages/",[555],{"type":33,"value":556},"loading pages behind a login",{"type":33,"value":558}," shows how. The converter here sends none of them.",{"title":7,"searchDepth":560,"depth":560,"links":561},2,[562,563,564,565,566,567],{"id":38,"depth":560,"text":41},{"id":49,"depth":560,"text":52},{"id":150,"depth":560,"text":153},{"id":212,"depth":560,"text":215},{"id":440,"depth":560,"text":443},{"id":485,"depth":560,"text":488,"children":568},[569,571,572],{"id":492,"depth":570,"text":16},3,{"id":501,"depth":570,"text":19},{"id":543,"depth":570,"text":22},"markdown","content:tools:url-to-pdf.md","content","tools/url-to-pdf.md","md",1795536209279]