Skip to content

Commit 5b20dda

Browse files
committed
Update airgapped.mdx
1 parent 08a7a0f commit 5b20dda

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

website/src/content/docs/snippet/airgapped.mdx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ By default, the EmbedPDF Snippet is optimized for a zero-config developer experi
1212

1313
This guide walks through every CDN default in the snippet and shows how to redirect or disable each one.
1414

15-
## The Three Defaults to Know
15+
## The Defaults to Know
1616

1717
| Asset | Default source | Triggered by |
1818
| :--- | :--- | :--- |
1919
| `pdfium.wasm` | `cdn.jsdelivr.net/npm/@embedpdf/pdfium` | Viewer init |
2020
| PDFium font fallback (fonts for missing glyphs) | `cdn.jsdelivr.net/npm/@embedpdf/fonts-*` | Rendering text the PDF's embedded fonts can't cover |
2121
| Snippet UI + signature webfonts | `fonts.googleapis.com` / `fonts.gstatic.com` | Viewer init (UI font) and opening the Create Signature modal (signature fonts) |
22+
| Default stamp library | `cdn.jsdelivr.net/npm/@embedpdf/default-stamps` | Stamp plugin init (Rubber Stamp panel) |
2223

2324
Each of them is independently configurable via `EmbedPDF.init`.
2425

@@ -177,6 +178,38 @@ When a signature stylesheet is loaded, the snippet also calls `document.fonts.lo
177178

178179
The four defaults (Caveat, Dancing Script, Great Vibes, Pacifico) are all licensed under the SIL Open Font License, so you can freely redistribute them alongside a self-hosted build.
179180

181+
## 4. Disable or self-host the stamp library
182+
183+
The Rubber Stamp panel ships with a default stamp library that the stamp plugin loads at init from a locale-aware manifest on jsDelivr (`cdn.jsdelivr.net/npm/@embedpdf/default-stamps/{locale}/manifest.json`). The plugin fetches that manifest and the PDF it references, so it makes external requests on startup. Configure it through the top-level `stamp` key.
184+
185+
### Option A — Disable the default stamps
186+
187+
Pass an empty `manifests` array. No external request is made. The Rubber Stamp panel stays functional for user-created stamps via the local default library.
188+
189+
```js
190+
EmbedPDF.init({
191+
// ...
192+
stamp: { manifests: [] },
193+
});
194+
```
195+
196+
### Option B — Self-host the stamp manifest
197+
198+
Serve the manifest (and the PDF it references) from your own origin and point `manifests` at it. The manifest's `pdf` path is resolved relative to the manifest URL unless it is absolute.
199+
200+
```js
201+
EmbedPDF.init({
202+
// ...
203+
stamp: {
204+
manifests: [{ url: '/stamps/manifest.json' }],
205+
},
206+
});
207+
```
208+
209+
<Callout type="info">
210+
The empty in-memory "Custom Stamps" library is created locally and never hits the network. If you don't want the Rubber Stamp feature at all, you can also pass `stamp: { manifests: [], defaultLibrary: false }`, and hide the toolbar button entirely by disabling the `insert-rubber-stamp` category (see [Customizing the UI](./customizing-ui#disabling-features)).
211+
</Callout>
212+
180213
## Complete airgapped example
181214

182215
Putting it all together:
@@ -205,6 +238,9 @@ EmbedPDF.init({
205238
ui: null,
206239
signature: null,
207240
},
241+
242+
// 4. No default stamp library fetched from the CDN.
243+
stamp: { manifests: [] },
208244
});
209245
```
210246

0 commit comments

Comments
 (0)