PDF viewer / editor / redactor built on pdf.js (render) + pdf-lib (write). The fourth sandboxed heavy-JS plugin. pdf.js runs WORKER-FREE on the main thread and the frame fetches nothing: under the framed CSP's connect-src 'none' the document bytes arrive over the postMessage bridge, which means the frame holding a confidential PDF structurally cannot exfiltrate it. Canonical doc is an annotation OVERLAY ({src, annotations[], formFields{}, redactions[], pageOps[]}) in PDF user space, never the file bytes. Host-selected mode (view/annotate/redact) is enforced on both sides. Redaction rasterizes affected pages and rebuilds a fresh document, then verifies the output before releasing it; download and print are host capabilities because the CSP sandbox token forbids them in-frame.
Install and mount
go get github.com/DonaldMurillo/gofastr-plugins@v0.5.0
import "github.com/DonaldMurillo/gofastr-plugins/pdf"
app.RegisterPlugin(pdf.New())Isolation
Runs in an opaque-origin iframe
Manifest
- Module path
- github.com/DonaldMurillo/gofastr-plugins/pdf
- Plugin version
- 0.1.0
- Framework compat
- >=0.28.0
- Isolation
- sandbox-iframe-opaque
- Sandbox tokens
- allow-scripts
- Capabilities
- document:read, document:write, theme:read
- Optional capabilities
- pdf:export
- CSP additions
- none
- Route prefix
/__gofastr/plugin/pdf- Entry
/__gofastr/plugin/pdf/viewer.html- Schema
- pdf-v1
- Min height
- 480px
- Docs
- docs/pdf.md