> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.templated.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Clickable Links in PDFs

You can make any layer clickable in a PDF render. When someone clicks that area of the PDF, the link opens in their browser.

## Add a link via API

Add the `link` property to the layer and render with `"format": "pdf"`:

```json
{
  "template": "TEMPLATE_ID",
  "format": "pdf",
  "layers": {
    "cta-button": {
      "text": "Shop Now",
      "link": "https://example.com/shop"
    },
    "logo": {
      "link": "https://example.com"
    }
  }
}
```

## Add a link in the editor

1. Select the layer.
2. Open the layer's actions menu and click **Add Link**.
3. Enter the URL (starting with https://).
4. Save the template.

The link is included in every PDF rendered from this template. You can still change it per render with the `link` property.

## Rules

- **The URL must start with `http://` or `https://`.** Other links, such as `mailto:` (email) or `tel:` (phone), are ignored and the layer is not clickable.
- **PDF only.** JPG, PNG, WebP and MP4 files cannot contain links.
- **The whole layer becomes clickable**, not only part of the text.
- Works on text, image and shape layers.
- Do not put `<a href="...">` tags inside the `text` property. Use `link`.

### Email or phone links

`mailto:` and `tel:` links are not supported. Alternatives:

- Show the email or phone as text, without a link.
- Link to a web page that has your contact options, for example `https://example.com/contact`.
- For WhatsApp, use a web link such as `https://wa.me/15551234567`.

## Example: business card

```json
{
  "template": "TEMPLATE_ID",
  "format": "pdf",
  "layers": {
    "company-name": { "text": "ACME Corp", "link": "https://acme.com" },
    "booking": { "text": "Book a call", "link": "https://acme.com/book" }
  }
}
```

## Test your links

1. Create the PDF render.
2. Open the PDF in a PDF reader (Adobe Acrobat, Preview, or a browser).
3. Click the linked areas.

## FAQ

Q: How do I add a clickable link to my PDF?
A: Add `"link": "https://..."` to the layer and render with `"format": "pdf"`, or use Add Link on the layer in the editor.

Q: Why is my link not clickable?
A: Check that the render format is PDF and that the URL starts with `http://` or `https://`. Links do not work in images.

Q: Can I use mailto: or tel: links?
A: No. Only http:// and https:// links are supported. Link to a contact page instead, or use a `https://wa.me/` link for WhatsApp.

Q: Can I link only one word in a sentence?
A: No. The link covers the whole layer. Put the word in its own text layer to make only that part clickable.

Q: Do links work in PNG or JPG?
A: No. Images cannot contain links. Use PDF.