Service Discontinuation Notice
The Save to PDF Link service is being discontinued on October 15, 2026.
Please migrate to our modern WebSave as PDF solution, which offers:
- Better performance and reliability
- More customization options
- Active development and support
See our migration guide for step-by-step instructions.
Save to PDF Link
Copy and paste this code into your web pages. It creates a link that converts the containing web page to PDF.
Code
<a href="//pdfcrowd.com/url_to_pdf/?" onclick="if(!this.p)href+='&url='+encodeURIComponent(location.href);this.p=1"> Save to PDF </a>
Options
You can customize the generated PDF using these URL parameters:
| URL Parameter | Description |
|---|---|
width |
PDF page width. |
height |
PDF page height. Use -1 for a single page PDF. |
hmargin |
Horizontal page margins. |
vmargin |
Vertical page margins. |
footer_text |
Footer text. The following variables are expanded:
|
use_print_media |
Uses the print CSS media type if available. |
pdf_name |
The file name of the created PDF. If not specified then the name is auto-generated. |
no_javascript |
Does not run JavaScript in the web page. |
Page dimensions and margins can be specified in inches in,
millimeters mm, centimeters cm, or points pt. If no units
are specified, points are assumed.
Examples
- A4 page
//pdfcrowd.com/url_to_pdf/?width=210mm&height=297mm
- Letter page
//pdfcrowd.com/url_to_pdf/?width=8.5in&height=11in
- Single-page PDF
//pdfcrowd.com/url_to_pdf/?height=-1
- Add the current page number to the page footer
//pdfcrowd.com/url_to_pdf/?footer_text=page%20$p
- Use the print version of the page
//pdfcrowd.com/url_to_pdf/?use_print_media=1
- Do not run JavaScript
//pdfcrowd.com/url_to_pdf/?no_javascript=1
Tips
- You can use the following classes in your HTML code to hide or remove
elements from the output:
-
pdfcrowd-remove- setsdisplay:noneon the element pdfcrowd-hide- setsvisibility:hiddenon the element
-
- You can force a page break with this HTML:
<div style="page-break-before:always"></div> - You can avoid a page break inside an element with this CSS:
img { page-break-inside:avoid } -
Class
pdfcrowd-bodyis automatically set on the body element, you can specify PDF specific styling (since v2.20.10):
.pdfcrowd-body h1 { font-size: 48px; }
How It Works
- The web page must be accessible on the public Internet.
- Only a web page from the same origin can be converted, it is not possible to specify an URL from a different origin.