PDF Button Generator
Generate a ready-to-paste HTML button that opens or downloads a PDF from a URL — set the label, action, colors, and corner radius, then copy the self-contained embed code. Links straight to your PDF, no sign-up and no third-party viewer involved.
Input
Style
Output
Your button will appear here.
The real generated button, isolated in a Shadow DOM so the page's own styles can't affect it.
Guides
Paste the link to any PDF, and this tool generates a ready-to-paste HTML button — a styled <a> tag that opens or downloads that PDF when clicked. It's the fastest way to add a "View PDF" or "Download PDF" call-to-action to a website, landing page, or email template without writing any CSS.
How to use it
- Paste the PDF URL — a direct link to a hosted PDF file (your own site, S3, Google Drive's direct-download link, etc.).
- Set the Button Text — what the button says, e.g. "View PDF" or "Download Brochure".
- Choose the Action — "Open in new tab" opens the PDF in the browser's built-in viewer; "Download file" forces a save-to-disk download instead.
- Adjust the Style section — toggle the small file icon, pick a background/text color, and set the corner radius.
- Copy the generated HTML and paste it into your page, CMS block, or email HTML.
Why a generator instead of a bare <a> tag
The output is a single, self-contained <a> element with all its styling inline (style="...") — no external stylesheet or class names required, so it renders identically wherever you paste it: a static HTML page, a WordPress custom-HTML block, a Markdown file that allows raw HTML, or an email template. "Open in new tab" mode automatically adds target="_blank" rel="noopener noreferrer" (the safe way to open an external link); "Download file" mode adds the download attribute instead, so the browser saves the file rather than navigating to it.
Privacy
Everything happens in your browser — the PDF URL and your styling choices never leave your device, and no PDF is uploaded or processed. The button simply links to the URL you provide.
FAQ
Does this host or store my PDF?
No. The tool only generates a link to the PDF URL you paste — it never uploads, fetches, or stores the file itself. Your PDF needs to already be hosted somewhere reachable by whoever clicks the button.
Can I embed the PDF itself on the page, not just a button to it?
Yes — use the PDF Embed Code Generator instead, which generates an <iframe> that displays the PDF inline on your page.
I need a plain, unstyled <button> or <a> element instead
The HTML Button Generator generates a bare, unstyled <button> tag if you'd rather apply your own CSS classes.
Use it from code
From 3 credits per callREST API
curl -X POST https://api.iotools.cloud/v1/tool/pdf-button-generator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pdfUrl": "https://example.com/document.pdf",
"buttonText": "View PDF",
"action": "open",
"showIcon": "true",
"backgroundColor": "#dc2626",
"textColor": "#ffffff",
"borderRadius": "6"
}'Swap in your own key from your account. The tool's fields are the body — no wrapper.
Ask an AI agent
Use the IOTools `pdf-button-generator` tool (PDF Button Generator) on this input:
YOUR_INPUT_HEREPaste this at any agent connected to the IOTools MCP server, then add your input.