◆ FREE BROWSER BUTTON · NO API KEY 1,000 CONVERSIONS / MONTH · 10 PAGES PER PDF

One-line Save as PDF link — drop into any web page.

Paste a single <a> tag into your HTML and visitors get a one-click PDF of the page they're on. The free service is hosted by SelectPdf — no API key, no server-side install, no SDK. 15 query-string parameters tune page size, margins, filename, security and rendering.

§THE SNIPPET

Paste this anywhere on your page.

Works on any HTML page — no JavaScript framework required. The onclick handler appends the current URL once and lets the anchor follow through to SelectPdf, which streams the PDF back as a download.

save-as-pdf.html
<a href="https://selectpdf.com/export-to-pdf/?"
   onclick="if(!this.urlAdded)this.href+='&url='+encodeURIComponent(location.href);this.urlAdded=1">Save as Pdf</a>

That's the whole product. The anchor points to /export-to-pdf/; the click handler URL-encodes location.href and appends it as the url parameter so the server can validate it against the Referer header. Customize the PDF by adding the 15 query-string parameters from the reference below.

HOW IT WORKS

Four steps from click to PDF download.

  1. The visitor clicks the Save as Pdf link on your page.
  2. The inline onclick appends &url= + the URL-encoded value of location.href to the anchor's href. The flag this.urlAdded stops it from being appended twice if the user clicks the link a second time.
  3. The browser follows the link to /export-to-pdf/. SelectPdf reads the URL from Request.UrlReferrer and verifies the url query parameter contains the same host.
  4. The conversion runs server-side and the PDF streams back as a download with Content-Type: application/pdf and the filename set from pdf_name.
Why the url + Referer round-trip? It's an anti-abuse check. /export-to-pdf/ can only convert the page the visitor is on — not an arbitrary third-party URL. Calling the endpoint directly without a Referer header redirects to the homepage. This keeps the free service from being turned into a generic URL-to-PDF gateway.
EXAMPLES

Three drop-in presets — copy and ship.

Each preset is a complete anchor tag with the query string already filled in. The Try this preset → button on each card uses the same onclick trick to convert this page so you can see exactly what comes back before you wire it into your own HTML.

LETTER · LANDSCAPE

US Letter, landscape orientation

Render the page on US Letter paper turned sideways — useful for wide tables or dashboards that don't fit Portrait.

example.html
<a href="https://selectpdf.com/export-to-pdf/?page_size=Letter&page_orientation=Landscape"
   onclick="if(!this.urlAdded)this.href+='&url='+encodeURIComponent(location.href);this.urlAdded=1">Save as Pdf</a>
Try this preset →
ZERO MARGINS · NO PAGE NUMBERS

Edge-to-edge, no page numbers

Strip all four margins and the footer page-number stamp. The page content occupies the entire PDF surface — useful when capturing a print-styled page that already has its own padding.

example.html
<a href="https://selectpdf.com/export-to-pdf/?margin_top=0&margin_right=0&margin_bottom=0&margin_left=0&page_numbers=false"
   onclick="if(!this.urlAdded)this.href+='&url='+encodeURIComponent(location.href);this.urlAdded=1">Save as Pdf</a>
Try this preset →
FILENAME · PASSWORD

Custom filename, user password

Save the PDF as Report.pdf and require the password "Test" to open it. Combine with owner_password to lock down printing, copying and editing.

example.html
<a href="https://selectpdf.com/export-to-pdf/?pdf_name=Report&user_password=Test"
   onclick="if(!this.urlAdded)this.href+='&url='+encodeURIComponent(location.href);this.urlAdded=1">Save as Pdf</a>
Try this preset →
§PARAMETERS

15 query-string parameters, in one place.

Append any combination to the anchor's href — they are read by the /export-to-pdf/ endpoint and applied to the conversion. All are optional; defaults are used when omitted.

§ PAGE SETUP 4 PARAMETERS

Page size, orientation, numbering and filename

How the generated PDF is laid out and named. All optional — sensible defaults apply when omitted.

PARAMETER
DESCRIPTION
page_size
enum default: A4
Page size of the generated PDF document.
A1 A2 A3 A4 A5 Letter HalfLetter Ledger Legal
page_orientation
enum default: Portrait
Page orientation of the generated PDF document.
Portrait Landscape
page_numbers
bool default: True
When enabled, the current page number is rendered in the footer of every PDF page.
True False
pdf_name
string default: Document.pdf
Filename of the generated PDF, used in the Content-Disposition response header. Browsers offer this name when the visitor saves the PDF.
§ MARGINS 4 PARAMETERS

All four page margins

Measured in points (1pt = 1/72in). Default 5pt on every side. Set to 0 for an edge-to-edge PDF.

PARAMETER
DESCRIPTION
margin_top
int (pt) default: 5
Top margin of the generated PDF, in points.
margin_right
int (pt) default: 5
Right margin of the generated PDF, in points.
margin_bottom
int (pt) default: 5
Bottom margin of the generated PDF, in points.
margin_left
int (pt) default: 5
Left margin of the generated PDF, in points.
§ SECURITY 2 PARAMETERS

Password-protect the PDF

Either or both can be set. The user password gates opening; the owner password gates printing, copying and editing inside a PDF reader.

PARAMETER
DESCRIPTION
user_password
string
Password required to open the generated PDF document.
owner_password
string
Password required to view or modify (print, copy, edit) the generated PDF document.
§ RENDERING 5 PARAMETERS

Browser window, CSS media type, load timing

Tune how the page is rendered before it is captured. Larger min_load_time helps pages with deferred JavaScript or lazy-loaded images.

PARAMETER
DESCRIPTION
use_css_print
bool default: False
Use the CSS Print media type instead of Screen. Enable when the page has @media print styles.
True False
web_page_width
int (px) default: 1024
Width of the internal browser window used to render the page, in pixels.
web_page_height
int (px) default: 0
Height of the internal browser window. 0 means automatic — the renderer captures the full page height.
min_load_time
int (s) default: 1
Minimum delay before the conversion starts, in seconds. Increase for pages with content that renders after the load event.
max_load_time
int (s) default: 30
Maximum time the converter will wait for the page to load. Returns a timeout error if exceeded. Up to 120 seconds allowed.
TERMS OF USE

Free, with four conditions.

  1. Keep the link visible. The conversion link must stay rendered on your page and point directly to selectpdf.com. Hidden links, link cloaking and CSS tricks that conceal the anchor are not permitted.
  2. 1,000 conversions per month per site. The free service is intended for sites that need up to 1,000 conversions per month. Past that, please use the paid HTML to PDF API — same engine, no per-page cap, no link requirement.
  3. 10 pages per PDF maximum. The generated PDF is capped at 10 pages. Pages that render longer than that are truncated. For longer PDFs, use the HTML to PDF API or the .NET PDF library.
  4. HTTPS pages must link to the HTTPS endpoint. If your page is served over HTTPS, the anchor's href must point to https://selectpdf.com/export-to-pdf/. Mixed-content rules block plain-HTTP links from a secure page.
WHEN YOU OUTGROW IT
Upgrade to the HTML to PDF API

The paid HTML to PDF API uses the same rendering engines (WebKit · WebKit Restricted · Blink · Chromium), exposes 90 parameters instead of 15, removes the page cap and the link-visibility requirement, and converts any URL — not just the visitor's current page. Plans start at $19 / month and include a 7-day free trial with 200 conversions, no credit card.

?FAQ

Save as PDF link, answered.

Six quick answers about the free Save-as-PDF link. For the full parameter surface, see the 15-parameter reference above.

No. The Save-as-PDF link is a free hosted service — paste the anchor tag into your HTML and it works. The HTML to PDF API requires a key; the Save-as-PDF link does not.
Only the page the visitor is currently on. The link's onclick handler reads location.href and sends it as the url parameter; the server then checks it against the Referer header. You cannot point the link at an arbitrary third-party URL.
Up to 1,000 conversions per month per site, and a maximum of 10 pages per generated PDF. The link must stay visible and point to SelectPdf. For higher volumes or no page cap, use the paid HTML to PDF API.
Yes — but the anchor's href must point to the HTTPS version of selectpdf.com (https://selectpdf.com/export-to-pdf/). Mixed-content rules in the browser will block the request if an HTTPS page links to an HTTP endpoint.
Yes. Append query-string parameters to the anchor href — 15 options cover page size, orientation, filename, all four margins, page numbers, owner/user passwords, the CSS Print media type and the rendering window size and load timing. See the parameter reference.
If you need more than 1,000 conversions per month, PDFs longer than 10 pages, conversion of arbitrary URLs (not just the visitor's current page), or no SelectPdf-branded link on your site. The HTML to PDF API supports up to 100,000+ conversions per month and 90 parameters.