How-to · Forms
How to embed a PDF editor in your website or app
By the PDFBetter teamPublished 4 min read
Short answer
To embed a PDF editor in your website, allow your site's address in PDFBetter's embed settings, create a publishable key, and paste the script snippet with the link to your PDF. Visitors fill fields, sign, add text, check marks and dates, then press Submit; your page gets the field values and a link to the flattened PDF, and your server can get the same submission as a signed webhook.
Do it now, without leaving this page
Drop a PDF hereLet go to start
or paste with Ctrl/⌘+V
On this page (6)
When does an embedded PDF editor make sense?
If your customers download a PDF, fill it in another app, and email it back, every step is a place where they give up. An embedded editor keeps the whole task on your page: the form opens in place, the person fills and signs it, and the result comes straight back to you with the values already separated from the PDF.
- Customer portals that collect applications, intake forms or onboarding paperwork.
- Property managers and lenders whose forms must keep their official layout.
- SaaS products where users already work, and a PDF step shouldn't send them elsewhere.
- Internal tools where staff fill the same templates every day.
The people filling don't need a PDFBetter account. The documents belong to your account, and you decide which websites may show the editor.
How do you add the editor to a page?
- 1
Allow your website
In Settings → Embedded editor, add the exact address of each site that will show the editor, for example https://portal.example.com. You can list up to 25. http://localhost works while you test.
- 2
Create a publishable key
Press Create key. The key starts with pb_embed_ and goes in your page's code. It can only open editor sessions, and only on the sites you listed, so it doesn't need to be kept secret.
- 3
Paste the script snippet
Copy the snippet from settings. It loads /embed.js and calls PDFBetter.embed with a container element, your key and the link to your PDF. Use PDFBetter.open instead for a full-screen modal.
- 4
Handle the submission
Your onSubmit callback receives the field values and a download link for the flattened PDF that works for one hour. Save what you need on your side.
No JavaScript on the page? An iframe pointing at /embed/editor/ with your key and the PDF link in the address works too. Your page then reads the editor's messages with a message listener that checks they come from the editor's origin.
Choose the tools people see
Pass tools: ["fill", "sign"] for a form that only needs filling and a signature, or add text, check and date for free-form paperwork. Set submitLabel to say “Send application” instead of “Submit”, and locale for English, Spanish, French, German or Japanese.
Which PDFs can visitors open?
Four sources cover most setups. A public https link is downloaded by PDFBetter's servers, with checks that refuse private network addresses and re-check every redirect. A file your page already has (for example one the visitor picked, or one your server generated) can be passed straight to the editor with the file option. One of your own PDFBetter documents or templates opens by its id, with the fields you set up in the full editor. And blank pages are there for a signature or a note on an empty sheet.
Fillable PDFs keep their fields, so a government form or an existing application works without rebuilding it. Any PDF can be signed and annotated, fillable or not. For password-protected PDFs and links behind a login, pass the file from your page.
How does the submission reach your systems?
Pressing Submit validates required fields first, then produces one flattened PDF with everything the person entered. Three routes deliver it, and you can use any of them together:
- In the page: the onSubmit callback (or a submitted message for plain iframes) carries the field values and a one-hour download link.
- On your server: a webhook endpoint subscribed to embed.document_submitted receives the values and a 24-hour link, signed with your webhook secret, retried if your server is down.
- In your account: Settings → Embedded editor lists recent submissions with a download button for 30 days.
Signature and photo values are left out of the webhook body because they're already drawn into the PDF; the payload lists which fields were left out so your code can tell an empty field from an image.
What keeps the embed secure?
Embedding a third-party editor raises fair questions, so here is what the embed actually does. Each editor runs on a short-lived signed session token bound to one document and one website, never on cookies, which is also why it works in Safari and in browsers that block cross-site cookies. The editor page only allows itself to be framed by that one website, through a Content-Security-Policy frame-ancestors header. Every message between your page and the editor is checked against the expected origin and addressed to it by name.
Abuse is held back by the website list, rate limits per key and per network, and the monthly session allowance: Enterprise includes 20,000 documents opened per month. When it runs out, visitors see a polite “temporarily unavailable” message and you get a notice in your account, rather than a broken page.
Try Fill PDF on your own file.
No account needed to start, and tools that run in your browser never upload your file. Keep going on the free plan, or pick a plan when you need more.
Questions people ask
Do the people filling the form need an account?
No. They fill and sign without signing up. The documents are stored under your account in an embed area, kept 30 days after submission and 24 hours if never submitted.
Can I show my own logo?
Yes. Turn on branding in the embed settings and the editor shows your team's logo and brand color from Team & branding. A small “Powered by PDFBetter” link stays at the bottom.
Is the embedded signature the same as a signature request?
No. The embed places a drawn, typed or uploaded signature on the page. Signature requests add emails to each signer, a certificate of completion and a sealed PDF; use those when you need that record.
Which plan includes the embedded editor?
The Enterprise plan, with 20,000 embed sessions a month on up to 25 websites. Downloads produced by submissions use the plan's normal download allowance.
Can visitors edit the PDF's original text?
Not in the embed. It fills fields and adds signatures, text boxes, check marks and dates. Editing the original text, redaction and page changes are in the full PDFBetter editor.
Sources
- PDFBetter embedded editor — pdfbetter.com, checked
- PDFBetter developer docs — pdfbetter.com, checked