Paste the following code verbatim into your HTML. It creates a link that converts the current page to PDF.
<a href="//pdfcrowd.com/url_to_pdf/?" onclick="if(!this.p)href+='&url='+encodeURIComponent(location.href);this.p=1"> Save to PDF </a>
You can customize the PDF using these URL parameters:
Parameter | Description |
---|---|
width | Page width. |
height | 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 | Use 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 | Do not run JavaScript in the web page. |
Page dimensions and margins can be specified in inches (in), millimetres (mm), centimetres (cm), or points (pt). If no units are specified, points are assumed.
//pdfcrowd.com/url_to_pdf/?width=210mm&height=297mm
//pdfcrowd.com/url_to_pdf/?width=8.5in&height=11in
//pdfcrowd.com/url_to_pdf/?height=-1
//pdfcrowd.com/url_to_pdf/?footer_text=page%20$p
//pdfcrowd.com/url_to_pdf/?use_print_media=1
//pdfcrowd.com/url_to_pdf/?no_javascript=1
Here is a demo Save to PDF Link that converts this page to PDF.
pdfcrowd-remove
- sets display:none on the elementpdfcrowd-hide
- sets visibility:hidden on the element<div style="page-break-before:always"></div>
img { page-break-inside:avoid }
The Save to PDF Link service is free, you don't need a Pdfcrowd account to use it. However, for commercial web sites, you might consider purchasing a Domain License for your domain which removes the Pdfcrowd branding from PDF.