@mecorelabs/free-pdf-sdk 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/dist/free-pdf-sdk.d.ts +2 -2
- package/dist/free-pdf-sdk.js +1 -1
- package/dist/free-pdf-sdk.js.map +1 -1
- package/package.json +1 -1
- package/third-party/README.md +2 -2
- package/third-party/crates.md +30 -30
- package/third-party/pdfcraft/ATTRIBUTION.md +39 -29
- package/version.json +2 -2
- package/viewer/{fps-viewer-a2ad2665f7.js → fps-viewer-85dcca9b96.js} +4 -4
- package/viewer/fps-viewer-ed545cbd01_bg.wasm +4 -0
- package/viewer/index.html +2 -2
- package/viewer/fps-viewer-2048cf2709_bg.wasm +0 -4
package/NOTICE
CHANGED
|
@@ -8,7 +8,7 @@ Based on pdfcraft
|
|
|
8
8
|
Free PDF SDK is based on pdfcraft by the ArtCraft Team and the PdfCraft contributors
|
|
9
9
|
(https://github.com/storytold/pdfcraft), used as a Cargo dependency pinned to commit
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
0dc77fe4ed8810b9e9f25b9dd050afae662c062a (pdfcraft 0.13.0)
|
|
12
12
|
|
|
13
13
|
with Free PDF SDK modifications to pdfcraft's interface crate (pdfcraft-ui-egui): opt-in hooks
|
|
14
14
|
for white-label branding and for hiding features. The exact modified commit is in Cargo.lock
|
package/dist/free-pdf-sdk.d.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
21
|
/** The SDK version this wrapper belongs to. */
|
|
22
|
-
export declare const SDK_VERSION = "0.2.
|
|
22
|
+
export declare const SDK_VERSION = "0.2.2";
|
|
23
23
|
/** The postMessage protocol version this wrapper speaks. */
|
|
24
24
|
export declare const PROTOCOL_VERSION = 1;
|
|
25
25
|
/** Every mode, in documentation order. */
|
|
@@ -348,6 +348,6 @@ export declare const FreePdf: {
|
|
|
348
348
|
/** See {@link init}. */
|
|
349
349
|
readonly init: typeof init;
|
|
350
350
|
/** The wrapper's version. */
|
|
351
|
-
readonly version: "0.2.
|
|
351
|
+
readonly version: "0.2.2";
|
|
352
352
|
};
|
|
353
353
|
export default FreePdf;
|
package/dist/free-pdf-sdk.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
21
|
/** The SDK version this wrapper belongs to. */
|
|
22
|
-
export const SDK_VERSION = "0.2.
|
|
22
|
+
export const SDK_VERSION = "0.2.2";
|
|
23
23
|
/** The postMessage protocol version this wrapper speaks. */
|
|
24
24
|
export const PROTOCOL_VERSION = 1;
|
|
25
25
|
/** Every mode, in documentation order. */
|
package/dist/free-pdf-sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"free-pdf-sdk.js","sourceRoot":"","sources":["../src/free-pdf-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC,4DAA4D;AAC5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,0CAA0C;AAC1C,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAWzG,6CAA6C;AAC7C,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,aAAa;IACb,UAAU;IACV,UAAU;IACV,YAAY;IACZ,mBAAmB;IACnB,gBAAgB;IAChB,OAAO;IACP,WAAW;IACX,aAAa;IACb,SAAS;IACT,WAAW;IACX,eAAe;IACf,WAAW;IACX,YAAY;IACZ,UAAU;IACV,SAAS;IACT,MAAM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AAC;AAED,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,wBAAwB;IACxB,IAAI;IACJ,6BAA6B;IAC7B,OAAO,EAAE,WAAW;CACZ,CAAC;AAEX,eAAe,OAAO,CAAC","sourcesContent":["/**\n * Free PDF SDK: an embeddable PDF viewer and annotator for the web, based on pdfcraft.\n *\n * ```ts\n * import { FreePdf } from \"@mecorelabs/free-pdf-sdk\";\n * const viewer = await FreePdf.init(document.getElementById(\"viewer\")!, {\n * baseUrl: \"/free-pdf-sdk/\",\n * mode: \"annotate\",\n * theme: \"system\",\n * document: { url: \"/files/artwork.pdf\" },\n * });\n * viewer.on(\"annotationsChanged\", ({ count }) => console.log(count));\n * ```\n *\n * Each viewer is an iframe on the host's own origin (the SDK folder must be served from the same\n * origin as the page). The wrapper talks to it over a versioned postMessage protocol; see\n * docs/api.md and docs/architecture.md.\n *\n * @packageDocumentation\n */\n\n/** The SDK version this wrapper belongs to. */\nexport const SDK_VERSION = \"0.2.1\";\n\n/** The postMessage protocol version this wrapper speaks. */\nexport const PROTOCOL_VERSION = 1;\n\n/** Every mode, in documentation order. */\nexport const MODES = [\"view\", \"review\", \"annotate\", \"fill\", \"sign\", \"organize\", \"edit\", \"full\"] as const;\n\n/**\n * Viewer mode: a preset of {@link Feature | features}. `view` is read-only; `review` adds notes\n * and text markup; `annotate` every kind of annotation and Fill & Sign; `fill` form filling and\n * Fill & Sign; `sign` adds digital signatures; `organize` pages and bookmarks; `edit` full\n * authoring without security, redaction, digital signatures or JavaScript; `full` everything\n * except JavaScript. Fine-tune any mode with {@link InitOptions.features}.\n */\nexport type Mode = (typeof MODES)[number];\n\n/** Every feature, in documentation order. */\nexport const FEATURES = [\n \"comments\",\n \"markup\",\n \"shapes\",\n \"ink\",\n \"stamps\",\n \"measurement\",\n \"fillSign\",\n \"formFill\",\n \"formDesign\",\n \"digitalSignatures\",\n \"signaturePanel\",\n \"pages\",\n \"bookmarks\",\n \"editContent\",\n \"flatten\",\n \"redaction\",\n \"accessibility\",\n \"standards\",\n \"javascript\",\n \"security\",\n \"history\",\n \"save\",\n \"download\",\n \"export\",\n \"print\",\n \"search\",\n \"copy\",\n \"documentInfo\",\n \"help\",\n \"palette\",\n \"preferences\",\n] as const;\n\n/**\n * Something the viewer can offer. A feature that is off is hidden everywhere in the viewer\n * (menus, toolbars, panels, context menus, shortcuts) and refused if reached anyway. The docs'\n * configuration page describes each one.\n */\nexport type Feature = (typeof FEATURES)[number];\n\n/** Feature switches, applied on top of the mode's features. */\nexport type FeatureFlags = Partial<Record<Feature, boolean>>;\n\n/** Right-hand panels {@link UiOptions.panels} accepts. */\nexport type PanelName = \"comments\" | \"bookmarks\" | \"pages\" | \"fields\" | \"layers\" | \"attachments\" | \"signatures\" | \"accessibility\" | \"tags\" | \"search\";\n\n/** Parts of the viewer's interface to show or hide (unset options keep their current value). */\nexport interface UiOptions {\n /** The Tools panel on the left, listing the tool groups of the enabled features (default true). */\n toolsPanel?: boolean;\n /** A slim rail that brings the Tools panel back once it is closed (default true). */\n toolsRail?: boolean;\n /** The floating tool bar beside the page (default true). */\n quickToolbar?: boolean;\n /** The right-hand rail: panel buttons, page navigation and zoom (default true). */\n rightRail?: boolean;\n /** Zoom and page display controls on the rail (default true). */\n zoomControls?: boolean;\n /** Page navigation on the rail (default true). */\n pageNavigation?: boolean;\n /** The main menu button (default true). */\n menu?: boolean;\n /** The \"Find tools and commands\" box (default true; needs the `palette` feature). */\n searchBox?: boolean;\n /** Show (true) or hide (false) right-hand panels; unlisted panels show when their feature is on. */\n panels?: Partial<Record<PanelName, boolean>>;\n /** Panels can't be moved, floated or closed from their tabs (default false). */\n lockLayout?: boolean;\n /** Also list tools that are planned but not available yet (default false). */\n showPlannedTools?: boolean;\n /** Links to web pages in documents may open, after a prompt (default true). */\n externalLinks?: boolean;\n}\n\n/** The viewer's configuration, as {@link FreePdfViewer.getConfig} reports it. */\nexport interface ViewerConfig {\n /** The mode. */\n mode: Mode;\n /** Every feature, on or off (the mode's preset with your overrides applied). */\n features: Record<Feature, boolean>;\n /** Interface options. */\n ui: Required<Omit<UiOptions, \"panels\">> & { panels: Partial<Record<PanelName, boolean>> };\n /** Hidden elements. */\n disabledElements: ElementId[];\n /** No feature that changes the document is on. */\n readOnly: boolean;\n}\n\n/** Colour theme; `system` follows the browser's preference. */\nexport type Theme = \"light\" | \"dark\" | \"system\";\n\n/** Zoom: a percentage (10–6400) or a fit. */\nexport type Zoom = number | \"fit-width\" | \"fit-page\";\n\n/**\n * Ids accepted by `disabledElements` and {@link FreePdfViewer.setDisabledElements}.\n * docs/api.md lists what each one hides.\n */\nexport type ElementId =\n | \"download\"\n | \"save\"\n | \"print\"\n | \"open\"\n | \"flatten\"\n | \"settings\"\n | \"import\"\n | \"tool:note\"\n | \"tool:freetext\"\n | \"tool:callout\"\n | \"tool:highlight\"\n | \"tool:underline\"\n | \"tool:strikeout\"\n | \"tool:squiggly\"\n | \"tool:caret\"\n | \"tool:replace\"\n | \"tool:ink\"\n | \"tool:line\"\n | \"tool:arrow\"\n | \"tool:square\"\n | \"tool:circle\"\n | \"tool:polygon\"\n | \"tool:polyline\"\n | \"tool:cloud\"\n | \"tool:attach\"\n | \"tool:stamp\"\n | \"tool:image\"\n | \"tool:link\"\n | \"tool:measure\"\n | \"tool:fillsign\"\n | \"tool:signature\";\n\n/** A PDF to open: fetched from a URL, or given as bytes. */\nexport type DocumentSource =\n | {\n /** URL of the PDF (same-origin, or CORS-enabled such as a Firebase Storage download URL). */\n url: string;\n /** File name shown in the viewer; defaults to the URL's last path segment. */\n name?: string;\n /** Options for `fetch` (headers, credentials). */\n fetchInit?: RequestInit;\n }\n | {\n /** The PDF's bytes. They are copied, never detached from the caller. */\n data: ArrayBuffer | Uint8Array | Blob;\n /** File name shown in the viewer; defaults to the Blob's name or `document.pdf`. */\n name?: string;\n };\n\n/**\n * The loading animation shown over the viewer while it starts and while a document opens.\n * Give one of `src` or `svg`; with neither, the built-in spinner is shown.\n */\nexport interface LoaderOptions {\n /** URL of an image: an SVG, GIF, animated WebP or PNG, or a `data:` URL. */\n src?: string;\n /** Inline SVG markup. It is shown as an image, so scripts in it never run. */\n svg?: string;\n /** Width of the image as a CSS length (default `48px`); the height follows its aspect ratio. */\n size?: string;\n /** Background behind it as a CSS colour (default: the viewer's background for the theme). */\n background?: string;\n /** What screen readers announce (default `Loading`). */\n label?: string;\n}\n\n/** A loader: a URL of an image (shorthand for `{ src }`), or {@link LoaderOptions}. */\nexport type Loader = string | LoaderOptions;\n\n/** Options for {@link FreePdf.init}. */\nexport interface InitOptions {\n /** URL of the SDK folder (the one holding `viewer/` and `version.json`), on the page's origin. */\n baseUrl: string;\n /** A document to open once the viewer is ready. */\n document?: DocumentSource;\n /** A preset of features (default `view`, read-only). */\n mode?: Mode;\n /** Turn individual features on or off, on top of the mode's preset. */\n features?: FeatureFlags;\n /** Show or hide parts of the interface. */\n ui?: UiOptions;\n /** Author of new comments; it wins over a name saved in the viewer's settings. */\n author?: string;\n /** Colour theme (default `system`). */\n theme?: Theme;\n /** Password: opens a document that needs one, and lifts owner restrictions (as {@link FreePdfViewer.unlock}). */\n password?: string;\n /** Parts of the interface to hide. */\n disabledElements?: ElementId[];\n /** Interface language, such as `en`, `de` or `zh-Hans` (closest available; English otherwise). */\n locale?: string;\n /**\n * Loading animation shown while the viewer starts and while a document opens (default: a\n * built-in spinner; `false`: none). Read once, when the viewer mounts.\n */\n loader?: Loader | false;\n /** Milliseconds to wait for a reply before rejecting with `TIMEOUT` (default 60000; loads get twice that). */\n timeoutMs?: number;\n /**\n * Listeners attached before the viewer starts, so they also hear events fired while `init`\n * is still running (`ready`, the first `documentLoaded`). `ready` also reaches listeners\n * added later with `on`.\n */\n listeners?: { [K in EventName]?: Listener<K> };\n}\n\n/** What the open document's security allows. */\nexport interface Permissions {\n /** Comments may be added, changed, deleted and imported. */\n canAnnotate: boolean;\n /** The document may be printed. */\n canPrint: boolean;\n /** Text and images may be copied. */\n canCopy: boolean;\n /** The document is encrypted. */\n isEncrypted: boolean;\n /** An owner password would lift restrictions ({@link FreePdfViewer.unlock}). */\n canUnlock: boolean;\n}\n\n/** A reply in a comment thread. */\nexport interface AnnotationReply {\n /** The reply's id (XFDF `name`). */\n id: string;\n /** Author (XFDF `title`). */\n author: string | null;\n /** Text. */\n contents: string | null;\n /** Last modified, ISO 8601. */\n date: string | null;\n}\n\n/** A comment, as {@link FreePdfViewer.getAnnotations} lists it. */\nexport interface Annotation {\n /** The annotation's id (XFDF `name`). */\n id: string;\n /** The PDF subtype in lowercase: `text` (note), `freetext`, `square`, `circle`, `line`, `ink`, `polygon`, `polyline`, `highlight`, `underline`, `squiggly`, `strikeout`, `stamp`, `caret`, `fileattachment`, `sound`, `redact`. */\n type: string;\n /** Author (XFDF `title`). */\n author: string | null;\n /** Subject. */\n subject: string | null;\n /** Text. */\n contents: string | null;\n /** Last modified (else created), ISO 8601. */\n date: string | null;\n /** 0-based page index. */\n pageIndex: number;\n /** Colour, `#RRGGBB`. */\n color: string | null;\n /** Replies, oldest first. */\n replies: AnnotationReply[];\n}\n\n/** A newly opened document. */\nexport interface DocumentInfo {\n /** Number of pages. */\n pageCount: number;\n /** What its security allows. */\n permissions: Permissions;\n}\n\n/** The result of {@link FreePdfViewer.load}. */\nexport interface LoadResult extends DocumentInfo {\n /** The `password` lifted owner restrictions. */\n unlocked: boolean;\n}\n\n/** Versions of the SDK and of pdfcraft. */\nexport interface VersionInfo {\n /** The SDK version (semver). */\n sdk: string;\n /** The pdfcraft commit the viewer was built from. */\n pdfcraftRev: string;\n}\n\n/** Error codes. `TIMEOUT`, `DESTROYED` and `FETCH_FAILED` come from the wrapper; the rest from the viewer. */\nexport type ErrorCode =\n | \"BAD_REQUEST\"\n | \"UNKNOWN_METHOD\"\n | \"UNSUPPORTED_PROTOCOL\"\n | \"NOT_READY\"\n | \"NO_DOCUMENT\"\n | \"LOAD_FAILED\"\n | \"NEEDS_PASSWORD\"\n | \"WRONG_PASSWORD\"\n | \"NOT_PERMITTED\"\n | \"READ_ONLY\"\n | \"XFDF_INVALID\"\n | \"TOO_LARGE\"\n | \"BUSY\"\n | \"INTERNAL\"\n | \"TIMEOUT\"\n | \"DESTROYED\"\n | \"FETCH_FAILED\";\n\n/** An error as data: what events carry. */\nexport interface ErrorInfo {\n /** Machine-readable code. */\n code: ErrorCode;\n /** Human-readable message (English). */\n message: string;\n}\n\n/** Every failure of the SDK: a typed code and a message. */\nexport class FreePdfError extends Error implements ErrorInfo {\n /** Machine-readable code. */\n readonly code: ErrorCode;\n\n /**\n * @param code - Machine-readable code.\n * @param message - Human-readable message.\n */\n constructor(code: ErrorCode, message: string) {\n super(message);\n this.name = \"FreePdfError\";\n this.code = code;\n }\n}\n\n/** Events and the data each one carries. */\nexport interface EventMap {\n /** The viewer is configured and ready for requests. */\n ready: VersionInfo;\n /** A document opened. */\n documentLoaded: DocumentInfo;\n /** A document could not be opened. */\n documentError: ErrorInfo;\n /** Comments were added, changed or removed (by the user or the API). */\n annotationsChanged: { count: number };\n /** The document gained or lost unsaved changes. */\n dirtyChanged: { dirty: boolean };\n /** Something failed outside a request (for example a wrong `password` at load). */\n error: ErrorInfo;\n /** The user pressed Save in the viewer: here is the saved PDF. The viewer treats it as saved. */\n saveRequested: { name: string; saveAs: boolean; data: Uint8Array };\n}\n\n/** An event name. */\nexport type EventName = keyof EventMap;\n\n/** A listener for event `K`. */\nexport type Listener<K extends EventName> = (data: EventMap[K]) => void;\n\n/** A mounted viewer. Every method is async and rejects with {@link FreePdfError}. */\nexport interface FreePdfViewer {\n /** Opens a document, replacing the one shown. */\n load(document: DocumentSource, options?: { password?: string }): Promise<LoadResult>;\n /** Lifts owner restrictions with the owner password; resolves to the new permissions. */\n unlock(password: string): Promise<Permissions>;\n /** What the open document's security allows. */\n getPermissions(): Promise<Permissions>;\n /** Imports comments from standard XFDF; `replace` deletes the existing ones first. Resolves to the number imported. */\n importXfdf(xfdf: string | Blob, options?: { replace?: boolean }): Promise<number>;\n /** The document's comments as XFDF (author in `title`). */\n exportXfdf(): Promise<string>;\n /** The document's comments with their replies; the length is the exact count. */\n getAnnotations(): Promise<Annotation[]>;\n /** Deletes every comment (one undo step per comment); resolves to how many there were. */\n deleteAllAnnotations(): Promise<number>;\n /** Sets the author of new comments. */\n setAuthor(author: string): Promise<void>;\n /** Sets the colour theme. */\n setTheme(theme: Theme): Promise<void>;\n /** Switches mode; your feature overrides still apply on top of it. */\n setMode(mode: Mode): Promise<void>;\n /** Replaces the feature overrides (relative to the mode). Pass `{}` to use the mode's features as they are. */\n setFeatures(features: FeatureFlags): Promise<void>;\n /** Changes interface options; options you leave out keep their value. */\n setUi(ui: UiOptions): Promise<void>;\n /** The resolved configuration: mode, every feature on or off, interface options. */\n getConfig(): Promise<ViewerConfig>;\n /** Hides parts of the interface (replaces the previous list). */\n setDisabledElements(ids: ElementId[]): Promise<void>;\n /** Sets the interface language; resolves to the language used. */\n setLocale(locale: string): Promise<string>;\n /** Number of pages. */\n getPageCount(): Promise<number>;\n /** Shows page `page` (1-based). */\n goToPage(page: number): Promise<void>;\n /** Sets the zoom: a percentage, `fit-width` or `fit-page`. */\n setZoom(zoom: Zoom): Promise<void>;\n /** Whether there are unsaved changes. */\n isDirty(): Promise<boolean>;\n /** The PDF with every change (comments included); the viewer then treats it as saved. */\n save(): Promise<Uint8Array>;\n /** Versions of the SDK and pdfcraft. */\n version(): Promise<VersionInfo>;\n /** Removes the viewer; pending requests reject with `DESTROYED`. Safe to call twice. */\n destroy(): Promise<void>;\n /** Adds a listener. */\n on<K extends EventName>(name: K, listener: Listener<K>): void;\n /** Removes a listener. */\n off<K extends EventName>(name: K, listener: Listener<K>): void;\n /** The iframe holding the viewer. */\n readonly iframe: HTMLIFrameElement;\n}\n\nconst HELLO_TIMEOUT_MS = 30_000;\nconst DEFAULT_TIMEOUT_MS = 60_000;\n\ninterface Pending {\n resolve: (value: unknown) => void;\n reject: (error: FreePdfError) => void;\n timer: ReturnType<typeof setTimeout>;\n}\n\ntype AnyListener = (data: never) => void;\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null;\n}\n\nfunction asErrorInfo(v: unknown): ErrorInfo {\n if (isRecord(v) && typeof v.code === \"string\" && typeof v.message === \"string\") {\n return { code: v.code as ErrorCode, message: v.message };\n }\n return { code: \"INTERNAL\", message: \"malformed error from the viewer\" };\n}\n\n/** A plain copy of interface options (a reactive proxy can't be posted to the iframe). */\nfunction plainUi(ui: UiOptions): Record<string, unknown> {\n const out: Record<string, unknown> = { ...ui };\n if (ui.panels) out.panels = { ...ui.panels };\n return out;\n}\n\nfunction channelId(): string {\n const bytes = new Uint8Array(16);\n crypto.getRandomValues(bytes);\n return Array.from(bytes, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction nameFromUrl(url: string): string {\n try {\n const last = new URL(url, location.href).pathname.split(\"/\").filter(Boolean).pop();\n return last ? decodeURIComponent(last) : \"document.pdf\";\n } catch {\n return \"document.pdf\";\n }\n}\n\n/** Copies the document's bytes into a fresh ArrayBuffer (safe to transfer). A URL is fetched within `timeoutMs`. */\nasync function readDocument(source: DocumentSource, timeoutMs: number): Promise<{ name: string; bytes: ArrayBuffer }> {\n if (\"url\" in source) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), timeoutMs);\n const callerSignal = source.fetchInit?.signal;\n const onAbort = (): void => controller.abort();\n callerSignal?.addEventListener(\"abort\", onAbort, { once: true });\n if (callerSignal?.aborted) controller.abort();\n try {\n const response = await fetch(source.url, { ...source.fetchInit, signal: controller.signal });\n if (!response.ok) throw new FreePdfError(\"FETCH_FAILED\", `could not fetch the document: HTTP ${response.status}`);\n return { name: source.name ?? nameFromUrl(source.url), bytes: await response.arrayBuffer() };\n } catch (e) {\n if (e instanceof FreePdfError) throw e;\n const why = controller.signal.aborted && !callerSignal?.aborted ? `no response in ${timeoutMs} ms` : String(e);\n throw new FreePdfError(\"FETCH_FAILED\", `could not fetch the document: ${why}`);\n } finally {\n clearTimeout(timer);\n callerSignal?.removeEventListener(\"abort\", onAbort);\n }\n }\n const data = source.data;\n if (data instanceof Blob) {\n const fileName = typeof File !== \"undefined\" && data instanceof File ? data.name : undefined;\n return { name: source.name ?? fileName ?? \"document.pdf\", bytes: await data.arrayBuffer() };\n }\n if (data instanceof ArrayBuffer) return { name: source.name ?? \"document.pdf\", bytes: data.slice(0) };\n if (data instanceof Uint8Array) {\n const copy = new Uint8Array(data.byteLength);\n copy.set(data);\n return { name: source.name ?? \"document.pdf\", bytes: copy.buffer };\n }\n throw new FreePdfError(\"BAD_REQUEST\", \"document needs a url or data (ArrayBuffer, Uint8Array or Blob)\");\n}\n\n/** The built-in loader: a ring that turns (slower when the user asks for reduced motion). */\nconst DEFAULT_LOADER_SVG =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 48 48\"><style>' +\n \"circle{fill:none;stroke-width:4;stroke-linecap:round}.t{stroke:rgba(128,128,136,.25)}\" +\n \".a{stroke:rgb(128,128,136);stroke-dasharray:30 200;transform-origin:24px 24px;animation:s .9s linear infinite}\" +\n \"@keyframes s{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.a{animation-duration:3s}}\" +\n '</style><circle class=\"t\" cx=\"24\" cy=\"24\" r=\"18\"/><circle class=\"a\" cx=\"24\" cy=\"24\" r=\"18\"/></svg>';\n\n/** Inline SVG markup is at most this long. */\nconst MAX_LOADER_SVG = 1024 * 1024;\n\n/** The loader as a plain, checked description (throws `BAD_REQUEST`), or `null` for none. */\nfunction loaderOptions(loader: Loader | false | undefined): LoaderOptions | null {\n if (loader === false) return null;\n if (loader === undefined) return { svg: DEFAULT_LOADER_SVG };\n if (typeof loader === \"string\") return { src: loader };\n if (!isRecord(loader)) throw new FreePdfError(\"BAD_REQUEST\", \"loader must be a URL, an object or false\");\n const out: LoaderOptions = {};\n for (const key of [\"src\", \"svg\", \"size\", \"background\", \"label\"] as const) {\n const v = loader[key];\n if (v === undefined) continue;\n if (typeof v !== \"string\") throw new FreePdfError(\"BAD_REQUEST\", `loader.${key} must be a string`);\n out[key] = v;\n }\n if (out.svg !== undefined && out.svg.length > MAX_LOADER_SVG) throw new FreePdfError(\"TOO_LARGE\", \"loader.svg is over 1 MiB\");\n if (out.src === undefined && out.svg === undefined) out.svg = DEFAULT_LOADER_SVG;\n return out;\n}\n\n/** The viewer's own background before it paints, so the loader matches it. */\nfunction themeBackground(theme: Theme): string {\n const dark = theme === \"dark\" || (theme === \"system\" && typeof matchMedia === \"function\" && matchMedia(\"(prefers-color-scheme: dark)\").matches);\n return dark ? \"#19191c\" : \"#f1f1f3\";\n}\n\n/** Builds the loader overlay (visible). */\nfunction loaderElement(options: LoaderOptions, theme: Theme): HTMLDivElement {\n const overlay = document.createElement(\"div\");\n overlay.setAttribute(\"role\", \"status\");\n overlay.dataset.fpsLoader = \"\";\n overlay.style.cssText = \"position:absolute;inset:0;display:flex;align-items:center;justify-content:center;transition:opacity .2s ease;\";\n overlay.style.background = options.background ?? themeBackground(theme);\n const img = document.createElement(\"img\");\n // An <img>: an SVG shown this way can't run scripts or load other resources.\n img.src = options.src ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(options.svg ?? DEFAULT_LOADER_SVG)}`;\n img.alt = options.label ?? \"Loading\";\n img.decoding = \"async\";\n img.style.cssText = \"display:block;height:auto;max-width:80%;max-height:80%;\";\n img.style.width = options.size ?? \"48px\";\n overlay.appendChild(img);\n return overlay;\n}\n\nclass Viewer implements FreePdfViewer {\n readonly iframe: HTMLIFrameElement;\n /** Holds the iframe and the loader; what the viewer adds to the host's element. */\n private readonly root: HTMLDivElement;\n private readonly loader: HTMLDivElement | null;\n /** Work the loader is shown for (starting counts as one). */\n private busy = 1;\n private readonly origin: string;\n private readonly channel = channelId();\n private readonly pending = new Map<number, Pending>();\n private readonly listeners = new Map<EventName, Set<AnyListener>>();\n private readonly timeoutMs: number;\n private nextId = 1;\n private destroyed = false;\n private hello: { resolve: (info: VersionInfo) => void; reject: (e: FreePdfError) => void } | null = null;\n private readyInfo: VersionInfo | null = null;\n private readonly onMessage = (event: MessageEvent): void => this.receive(event);\n\n constructor(element: HTMLElement, baseUrl: URL, timeoutMs: number, loader: LoaderOptions | null, theme: Theme) {\n this.origin = baseUrl.origin;\n this.timeoutMs = timeoutMs;\n this.root = document.createElement(\"div\");\n this.root.style.cssText = \"position:relative;width:100%;height:100%;\";\n this.iframe = document.createElement(\"iframe\");\n this.iframe.src = new URL(`viewer/index.html#ch=${this.channel}`, baseUrl).href;\n this.iframe.title = \"PDF viewer\";\n this.iframe.setAttribute(\"allow\", \"clipboard-read; clipboard-write; fullscreen\");\n this.iframe.style.cssText = \"display:block;width:100%;height:100%;border:0;\";\n this.root.appendChild(this.iframe);\n this.loader = loader ? loaderElement(loader, theme) : null;\n if (this.loader) this.root.appendChild(this.loader);\n window.addEventListener(\"message\", this.onMessage);\n element.appendChild(this.root);\n }\n\n /** Shows the loader for a piece of work; pair with {@link idle}. */\n busyStart(): void {\n this.busy++;\n if (this.loader) {\n this.loader.hidden = false;\n this.loader.style.opacity = \"1\";\n this.loader.style.pointerEvents = \"\";\n }\n }\n\n /** Ends a piece of work; the loader fades out when none is left. */\n idle(): void {\n this.busy = Math.max(0, this.busy - 1);\n const loader = this.loader;\n if (!loader || this.busy > 0) return;\n // Clicks reach the viewer at once, not only when the fade is over.\n loader.style.opacity = \"0\";\n loader.style.pointerEvents = \"none\";\n setTimeout(() => {\n if (this.busy === 0) loader.hidden = true;\n }, 200);\n }\n\n /** Waits for the viewer's hello. */\n started(): Promise<VersionInfo> {\n return new Promise<VersionInfo>((resolve, reject) => {\n const timer = setTimeout(() => {\n this.hello = null;\n reject(new FreePdfError(\"TIMEOUT\", \"the viewer did not start (is baseUrl right, and WebGL available?)\"));\n }, HELLO_TIMEOUT_MS);\n this.hello = {\n resolve: (info) => {\n clearTimeout(timer);\n resolve(info);\n },\n reject: (e) => {\n clearTimeout(timer);\n reject(e);\n },\n };\n });\n }\n\n private receive(event: MessageEvent): void {\n if (event.origin !== this.origin || event.source !== this.iframe.contentWindow) return;\n const msg: unknown = event.data;\n if (!isRecord(msg) || msg.ch !== this.channel) return;\n if (msg.fps !== PROTOCOL_VERSION) {\n // Another protocol version: fail what is waiting for it now, not after a timeout.\n const err = new FreePdfError(\"UNSUPPORTED_PROTOCOL\", `the viewer speaks protocol ${String(msg.fps)}; this wrapper speaks ${PROTOCOL_VERSION}`);\n if (msg.kind === \"hello\" && this.hello) {\n this.hello.reject(err);\n this.hello = null;\n return;\n }\n const p = msg.kind === \"res\" && typeof msg.id === \"number\" ? this.pending.get(msg.id) : undefined;\n if (p && typeof msg.id === \"number\") {\n this.pending.delete(msg.id);\n clearTimeout(p.timer);\n p.reject(err);\n return;\n }\n this.emit(\"error\", { code: err.code, message: err.message });\n return;\n }\n switch (msg.kind) {\n case \"hello\": {\n const info = isRecord(msg.info) ? msg.info : {};\n const version: VersionInfo = { sdk: String(info.sdk ?? \"\"), pdfcraftRev: String(info.pdfcraftRev ?? \"\") };\n if (version.sdk !== SDK_VERSION) {\n console.warn(`Free PDF SDK: the wrapper is ${SDK_VERSION} but the viewer is ${version.sdk}; serve matching files`);\n }\n this.hello?.resolve(version);\n this.hello = null;\n return;\n }\n case \"res\": {\n if (typeof msg.id !== \"number\") return;\n const p = this.pending.get(msg.id);\n if (!p) return;\n this.pending.delete(msg.id);\n clearTimeout(p.timer);\n if (msg.ok === true) p.resolve(msg.result);\n else {\n const e = asErrorInfo(msg.error);\n p.reject(new FreePdfError(e.code, e.message));\n }\n return;\n }\n case \"evt\": {\n if (typeof msg.name !== \"string\") return;\n if (msg.name === \"error\" && this.hello) {\n const e = asErrorInfo(msg.data);\n this.hello.reject(new FreePdfError(e.code, e.message));\n this.hello = null;\n return;\n }\n if (msg.name === \"documentError\" || msg.name === \"error\") {\n this.emit(msg.name, asErrorInfo(msg.data));\n } else if (this.listeners.has(msg.name as EventName)) {\n this.emit(msg.name as EventName, msg.data as never);\n }\n return;\n }\n default:\n return;\n }\n }\n\n emit<K extends EventName>(name: K, data: EventMap[K]): void {\n if (name === \"ready\") this.readyInfo = data as VersionInfo;\n for (const listener of [...(this.listeners.get(name) ?? [])]) {\n try {\n (listener as Listener<K>)(data);\n } catch (e) {\n console.error(`Free PDF SDK: a ${name} listener threw`, e);\n }\n }\n }\n\n request<T>(method: string, params?: Record<string, unknown>, transfer: Transferable[] = [], timeoutMs = this.timeoutMs): Promise<T> {\n if (this.destroyed) return Promise.reject(new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\"));\n const contentWindow = this.iframe.contentWindow;\n if (!contentWindow) return Promise.reject(new FreePdfError(\"NOT_READY\", \"the viewer is not attached to the page\"));\n const id = this.nextId;\n this.nextId = this.nextId >= 0x7fffffff ? 1 : this.nextId + 1;\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(() => {\n this.pending.delete(id);\n reject(new FreePdfError(\"TIMEOUT\", `${method} got no reply in ${timeoutMs} ms`));\n }, timeoutMs);\n this.pending.set(id, { resolve: resolve as (v: unknown) => void, reject, timer });\n // The viewer drops the request once the deadline has passed, so a request that timed out\n // here never takes effect later (frames stall in background tabs).\n const deadline = Date.now() + timeoutMs;\n try {\n contentWindow.postMessage({ fps: PROTOCOL_VERSION, ch: this.channel, kind: \"req\", id, method, params: params ?? {}, deadline }, this.origin, transfer);\n } catch (e) {\n clearTimeout(timer);\n this.pending.delete(id);\n reject(new FreePdfError(\"BAD_REQUEST\", `${method} could not be sent: ${e instanceof Error ? e.message : String(e)}`));\n }\n });\n }\n\n async load(source: DocumentSource, options?: { password?: string }): Promise<LoadResult> {\n if (this.destroyed) throw new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\");\n this.busyStart();\n try {\n let doc: { name: string; bytes: ArrayBuffer };\n try {\n doc = await readDocument(source, this.timeoutMs * 2);\n } catch (e) {\n // The viewer reports its own load failures; a fetch that failed never reached it.\n const err = e instanceof FreePdfError ? e : new FreePdfError(\"FETCH_FAILED\", String(e));\n this.emit(\"documentError\", { code: err.code, message: err.message });\n throw err;\n }\n const { name, bytes } = doc;\n const params: Record<string, unknown> = { name, data: bytes };\n if (options?.password !== undefined) params.password = options.password;\n return await this.request<LoadResult>(\"load\", params, [bytes], this.timeoutMs * 2);\n } finally {\n this.idle();\n }\n }\n\n async unlock(password: string): Promise<Permissions> {\n const r = await this.request<{ permissions: Permissions }>(\"unlock\", { password });\n return r.permissions;\n }\n\n getPermissions(): Promise<Permissions> {\n return this.request<Permissions>(\"getPermissions\");\n }\n\n async importXfdf(xfdf: string | Blob, options?: { replace?: boolean }): Promise<number> {\n const text = typeof xfdf === \"string\" ? xfdf : await xfdf.text();\n return this.request<number>(\"importXfdf\", { xfdf: text, replace: options?.replace ?? false });\n }\n\n exportXfdf(): Promise<string> {\n return this.request<string>(\"exportXfdf\");\n }\n\n getAnnotations(): Promise<Annotation[]> {\n return this.request<Annotation[]>(\"getAnnotations\");\n }\n\n deleteAllAnnotations(): Promise<number> {\n return this.request<number>(\"deleteAllAnnotations\");\n }\n\n async setAuthor(author: string): Promise<void> {\n await this.request(\"setAuthor\", { author });\n }\n\n async setTheme(theme: Theme): Promise<void> {\n await this.request(\"setTheme\", { theme });\n }\n\n async setMode(mode: Mode): Promise<void> {\n await this.request(\"setMode\", { mode });\n }\n\n async setFeatures(features: FeatureFlags): Promise<void> {\n await this.request(\"setFeatures\", { features: { ...features } });\n }\n\n async setUi(ui: UiOptions): Promise<void> {\n await this.request(\"setUi\", { ui: plainUi(ui) });\n }\n\n getConfig(): Promise<ViewerConfig> {\n return this.request<ViewerConfig>(\"getConfig\");\n }\n\n async setDisabledElements(ids: ElementId[]): Promise<void> {\n await this.request(\"setDisabledElements\", { ids: [...ids] });\n }\n\n async setLocale(locale: string): Promise<string> {\n const r = await this.request<{ locale: string }>(\"setLocale\", { locale });\n return r.locale;\n }\n\n getPageCount(): Promise<number> {\n return this.request<number>(\"getPageCount\");\n }\n\n async goToPage(page: number): Promise<void> {\n await this.request(\"goToPage\", { page });\n }\n\n async setZoom(zoom: Zoom): Promise<void> {\n await this.request(\"setZoom\", { zoom });\n }\n\n isDirty(): Promise<boolean> {\n return this.request<boolean>(\"isDirty\");\n }\n\n async save(): Promise<Uint8Array> {\n return this.request<Uint8Array>(\"save\", undefined, [], this.timeoutMs * 2);\n }\n\n version(): Promise<VersionInfo> {\n return this.request<VersionInfo>(\"version\");\n }\n\n async destroy(): Promise<void> {\n if (this.destroyed) return;\n this.destroyed = true;\n window.removeEventListener(\"message\", this.onMessage);\n const error = new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\");\n for (const p of this.pending.values()) {\n clearTimeout(p.timer);\n p.reject(error);\n }\n this.pending.clear();\n this.hello?.reject(error);\n this.hello = null;\n this.listeners.clear();\n this.root.remove();\n }\n\n on<K extends EventName>(name: K, listener: Listener<K>): void {\n let set = this.listeners.get(name);\n if (!set) {\n set = new Set();\n this.listeners.set(name, set);\n }\n set.add(listener as AnyListener);\n if (name === \"ready\" && this.readyInfo) {\n const info = this.readyInfo;\n queueMicrotask(() => {\n if (this.listeners.get(name)?.has(listener as AnyListener)) (listener as Listener<\"ready\">)(info);\n });\n }\n }\n\n off<K extends EventName>(name: K, listener: Listener<K>): void {\n this.listeners.get(name)?.delete(listener as AnyListener);\n }\n}\n\n/**\n * Mounts a viewer in `element` (which it fills) and resolves once it is ready and, if\n * `options.document` is given, once that document is open. Rejects with {@link FreePdfError}\n * (and removes the iframe) when the viewer cannot start or the document cannot be opened.\n *\n * @param element - The element to mount the viewer in; give it a size.\n * @param options - Where the SDK is hosted, and how the viewer starts.\n */\nexport async function init(element: HTMLElement, options: InitOptions): Promise<FreePdfViewer> {\n if (!(element instanceof HTMLElement)) throw new FreePdfError(\"BAD_REQUEST\", \"init needs an element to mount the viewer in\");\n if (!options || typeof options.baseUrl !== \"string\") throw new FreePdfError(\"BAD_REQUEST\", \"init needs options.baseUrl\");\n const base = new URL(options.baseUrl.endsWith(\"/\") ? options.baseUrl : `${options.baseUrl}/`, document.baseURI);\n if (base.origin !== location.origin) {\n throw new FreePdfError(\"BAD_REQUEST\", `the SDK must be served from this page's origin (${location.origin}), not ${base.origin}`);\n }\n const theme = options.theme ?? \"system\";\n const viewer = new Viewer(element, base, options.timeoutMs ?? DEFAULT_TIMEOUT_MS, loaderOptions(options.loader), theme);\n for (const [name, listener] of Object.entries(options.listeners ?? {})) {\n if (typeof listener === \"function\") viewer.on(name as EventName, listener as Listener<EventName>);\n }\n try {\n const info = await viewer.started();\n // Plain copies: a reactive proxy (Vue) can't be posted to the iframe.\n const config: Record<string, unknown> = {\n mode: options.mode ?? \"view\",\n theme,\n disabledElements: [...(options.disabledElements ?? [])],\n };\n if (options.features !== undefined) config.features = { ...options.features };\n if (options.ui !== undefined) config.ui = plainUi(options.ui);\n if (options.author !== undefined) config.author = options.author;\n if (options.locale !== undefined) config.locale = options.locale;\n await viewer.request(\"configure\", config);\n viewer.emit(\"ready\", info);\n if (options.document) {\n await viewer.load(options.document, options.password === undefined ? undefined : { password: options.password });\n }\n viewer.idle();\n return viewer;\n } catch (e) {\n await viewer.destroy();\n throw e instanceof FreePdfError ? e : new FreePdfError(\"INTERNAL\", String(e));\n }\n}\n\n/** The SDK entry point. */\nexport const FreePdf = {\n /** See {@link init}. */\n init,\n /** The wrapper's version. */\n version: SDK_VERSION,\n} as const;\n\nexport default FreePdf;\n"]}
|
|
1
|
+
{"version":3,"file":"free-pdf-sdk.js","sourceRoot":"","sources":["../src/free-pdf-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC,4DAA4D;AAC5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,0CAA0C;AAC1C,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,E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,EAAE,CAAC,CAAC;QACnH,CAAC;QACD,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QACvB,MAAM,CAAC,YAAY,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,CAAC;AACH,CAAC;AAED,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,wBAAwB;IACxB,IAAI;IACJ,6BAA6B;IAC7B,OAAO,EAAE,WAAW;CACZ,CAAC;AAEX,eAAe,OAAO,CAAC","sourcesContent":["/**\n * Free PDF SDK: an embeddable PDF viewer and annotator for the web, based on pdfcraft.\n *\n * ```ts\n * import { FreePdf } from \"@mecorelabs/free-pdf-sdk\";\n * const viewer = await FreePdf.init(document.getElementById(\"viewer\")!, {\n * baseUrl: \"/free-pdf-sdk/\",\n * mode: \"annotate\",\n * theme: \"system\",\n * document: { url: \"/files/artwork.pdf\" },\n * });\n * viewer.on(\"annotationsChanged\", ({ count }) => console.log(count));\n * ```\n *\n * Each viewer is an iframe on the host's own origin (the SDK folder must be served from the same\n * origin as the page). The wrapper talks to it over a versioned postMessage protocol; see\n * docs/api.md and docs/architecture.md.\n *\n * @packageDocumentation\n */\n\n/** The SDK version this wrapper belongs to. */\nexport const SDK_VERSION = \"0.2.2\";\n\n/** The postMessage protocol version this wrapper speaks. */\nexport const PROTOCOL_VERSION = 1;\n\n/** Every mode, in documentation order. */\nexport const MODES = [\"view\", \"review\", \"annotate\", \"fill\", \"sign\", \"organize\", \"edit\", \"full\"] as const;\n\n/**\n * Viewer mode: a preset of {@link Feature | features}. `view` is read-only; `review` adds notes\n * and text markup; `annotate` every kind of annotation and Fill & Sign; `fill` form filling and\n * Fill & Sign; `sign` adds digital signatures; `organize` pages and bookmarks; `edit` full\n * authoring without security, redaction, digital signatures or JavaScript; `full` everything\n * except JavaScript. Fine-tune any mode with {@link InitOptions.features}.\n */\nexport type Mode = (typeof MODES)[number];\n\n/** Every feature, in documentation order. */\nexport const FEATURES = [\n \"comments\",\n \"markup\",\n \"shapes\",\n \"ink\",\n \"stamps\",\n \"measurement\",\n \"fillSign\",\n \"formFill\",\n \"formDesign\",\n \"digitalSignatures\",\n \"signaturePanel\",\n \"pages\",\n \"bookmarks\",\n \"editContent\",\n \"flatten\",\n \"redaction\",\n \"accessibility\",\n \"standards\",\n \"javascript\",\n \"security\",\n \"history\",\n \"save\",\n \"download\",\n \"export\",\n \"print\",\n \"search\",\n \"copy\",\n \"documentInfo\",\n \"help\",\n \"palette\",\n \"preferences\",\n] as const;\n\n/**\n * Something the viewer can offer. A feature that is off is hidden everywhere in the viewer\n * (menus, toolbars, panels, context menus, shortcuts) and refused if reached anyway. The docs'\n * configuration page describes each one.\n */\nexport type Feature = (typeof FEATURES)[number];\n\n/** Feature switches, applied on top of the mode's features. */\nexport type FeatureFlags = Partial<Record<Feature, boolean>>;\n\n/** Right-hand panels {@link UiOptions.panels} accepts. */\nexport type PanelName = \"comments\" | \"bookmarks\" | \"pages\" | \"fields\" | \"layers\" | \"attachments\" | \"signatures\" | \"accessibility\" | \"tags\" | \"search\";\n\n/** Parts of the viewer's interface to show or hide (unset options keep their current value). */\nexport interface UiOptions {\n /** The Tools panel on the left, listing the tool groups of the enabled features (default true). */\n toolsPanel?: boolean;\n /** A slim rail that brings the Tools panel back once it is closed (default true). */\n toolsRail?: boolean;\n /** The floating tool bar beside the page (default true). */\n quickToolbar?: boolean;\n /** The right-hand rail: panel buttons, page navigation and zoom (default true). */\n rightRail?: boolean;\n /** Zoom and page display controls on the rail (default true). */\n zoomControls?: boolean;\n /** Page navigation on the rail (default true). */\n pageNavigation?: boolean;\n /** The main menu button (default true). */\n menu?: boolean;\n /** The \"Find tools and commands\" box (default true; needs the `palette` feature). */\n searchBox?: boolean;\n /** Show (true) or hide (false) right-hand panels; unlisted panels show when their feature is on. */\n panels?: Partial<Record<PanelName, boolean>>;\n /** Panels can't be moved, floated or closed from their tabs (default false). */\n lockLayout?: boolean;\n /** Also list tools that are planned but not available yet (default false). */\n showPlannedTools?: boolean;\n /** Links to web pages in documents may open, after a prompt (default true). */\n externalLinks?: boolean;\n}\n\n/** The viewer's configuration, as {@link FreePdfViewer.getConfig} reports it. */\nexport interface ViewerConfig {\n /** The mode. */\n mode: Mode;\n /** Every feature, on or off (the mode's preset with your overrides applied). */\n features: Record<Feature, boolean>;\n /** Interface options. */\n ui: Required<Omit<UiOptions, \"panels\">> & { panels: Partial<Record<PanelName, boolean>> };\n /** Hidden elements. */\n disabledElements: ElementId[];\n /** No feature that changes the document is on. */\n readOnly: boolean;\n}\n\n/** Colour theme; `system` follows the browser's preference. */\nexport type Theme = \"light\" | \"dark\" | \"system\";\n\n/** Zoom: a percentage (10–6400) or a fit. */\nexport type Zoom = number | \"fit-width\" | \"fit-page\";\n\n/**\n * Ids accepted by `disabledElements` and {@link FreePdfViewer.setDisabledElements}.\n * docs/api.md lists what each one hides.\n */\nexport type ElementId =\n | \"download\"\n | \"save\"\n | \"print\"\n | \"open\"\n | \"flatten\"\n | \"settings\"\n | \"import\"\n | \"tool:note\"\n | \"tool:freetext\"\n | \"tool:callout\"\n | \"tool:highlight\"\n | \"tool:underline\"\n | \"tool:strikeout\"\n | \"tool:squiggly\"\n | \"tool:caret\"\n | \"tool:replace\"\n | \"tool:ink\"\n | \"tool:line\"\n | \"tool:arrow\"\n | \"tool:square\"\n | \"tool:circle\"\n | \"tool:polygon\"\n | \"tool:polyline\"\n | \"tool:cloud\"\n | \"tool:attach\"\n | \"tool:stamp\"\n | \"tool:image\"\n | \"tool:link\"\n | \"tool:measure\"\n | \"tool:fillsign\"\n | \"tool:signature\";\n\n/** A PDF to open: fetched from a URL, or given as bytes. */\nexport type DocumentSource =\n | {\n /** URL of the PDF (same-origin, or CORS-enabled such as a Firebase Storage download URL). */\n url: string;\n /** File name shown in the viewer; defaults to the URL's last path segment. */\n name?: string;\n /** Options for `fetch` (headers, credentials). */\n fetchInit?: RequestInit;\n }\n | {\n /** The PDF's bytes. They are copied, never detached from the caller. */\n data: ArrayBuffer | Uint8Array | Blob;\n /** File name shown in the viewer; defaults to the Blob's name or `document.pdf`. */\n name?: string;\n };\n\n/**\n * The loading animation shown over the viewer while it starts and while a document opens.\n * Give one of `src` or `svg`; with neither, the built-in spinner is shown.\n */\nexport interface LoaderOptions {\n /** URL of an image: an SVG, GIF, animated WebP or PNG, or a `data:` URL. */\n src?: string;\n /** Inline SVG markup. It is shown as an image, so scripts in it never run. */\n svg?: string;\n /** Width of the image as a CSS length (default `48px`); the height follows its aspect ratio. */\n size?: string;\n /** Background behind it as a CSS colour (default: the viewer's background for the theme). */\n background?: string;\n /** What screen readers announce (default `Loading`). */\n label?: string;\n}\n\n/** A loader: a URL of an image (shorthand for `{ src }`), or {@link LoaderOptions}. */\nexport type Loader = string | LoaderOptions;\n\n/** Options for {@link FreePdf.init}. */\nexport interface InitOptions {\n /** URL of the SDK folder (the one holding `viewer/` and `version.json`), on the page's origin. */\n baseUrl: string;\n /** A document to open once the viewer is ready. */\n document?: DocumentSource;\n /** A preset of features (default `view`, read-only). */\n mode?: Mode;\n /** Turn individual features on or off, on top of the mode's preset. */\n features?: FeatureFlags;\n /** Show or hide parts of the interface. */\n ui?: UiOptions;\n /** Author of new comments; it wins over a name saved in the viewer's settings. */\n author?: string;\n /** Colour theme (default `system`). */\n theme?: Theme;\n /** Password: opens a document that needs one, and lifts owner restrictions (as {@link FreePdfViewer.unlock}). */\n password?: string;\n /** Parts of the interface to hide. */\n disabledElements?: ElementId[];\n /** Interface language, such as `en`, `de` or `zh-Hans` (closest available; English otherwise). */\n locale?: string;\n /**\n * Loading animation shown while the viewer starts and while a document opens (default: a\n * built-in spinner; `false`: none). Read once, when the viewer mounts.\n */\n loader?: Loader | false;\n /** Milliseconds to wait for a reply before rejecting with `TIMEOUT` (default 60000; loads get twice that). */\n timeoutMs?: number;\n /**\n * Listeners attached before the viewer starts, so they also hear events fired while `init`\n * is still running (`ready`, the first `documentLoaded`). `ready` also reaches listeners\n * added later with `on`.\n */\n listeners?: { [K in EventName]?: Listener<K> };\n}\n\n/** What the open document's security allows. */\nexport interface Permissions {\n /** Comments may be added, changed, deleted and imported. */\n canAnnotate: boolean;\n /** The document may be printed. */\n canPrint: boolean;\n /** Text and images may be copied. */\n canCopy: boolean;\n /** The document is encrypted. */\n isEncrypted: boolean;\n /** An owner password would lift restrictions ({@link FreePdfViewer.unlock}). */\n canUnlock: boolean;\n}\n\n/** A reply in a comment thread. */\nexport interface AnnotationReply {\n /** The reply's id (XFDF `name`). */\n id: string;\n /** Author (XFDF `title`). */\n author: string | null;\n /** Text. */\n contents: string | null;\n /** Last modified, ISO 8601. */\n date: string | null;\n}\n\n/** A comment, as {@link FreePdfViewer.getAnnotations} lists it. */\nexport interface Annotation {\n /** The annotation's id (XFDF `name`). */\n id: string;\n /** The PDF subtype in lowercase: `text` (note), `freetext`, `square`, `circle`, `line`, `ink`, `polygon`, `polyline`, `highlight`, `underline`, `squiggly`, `strikeout`, `stamp`, `caret`, `fileattachment`, `sound`, `redact`. */\n type: string;\n /** Author (XFDF `title`). */\n author: string | null;\n /** Subject. */\n subject: string | null;\n /** Text. */\n contents: string | null;\n /** Last modified (else created), ISO 8601. */\n date: string | null;\n /** 0-based page index. */\n pageIndex: number;\n /** Colour, `#RRGGBB`. */\n color: string | null;\n /** Replies, oldest first. */\n replies: AnnotationReply[];\n}\n\n/** A newly opened document. */\nexport interface DocumentInfo {\n /** Number of pages. */\n pageCount: number;\n /** What its security allows. */\n permissions: Permissions;\n}\n\n/** The result of {@link FreePdfViewer.load}. */\nexport interface LoadResult extends DocumentInfo {\n /** The `password` lifted owner restrictions. */\n unlocked: boolean;\n}\n\n/** Versions of the SDK and of pdfcraft. */\nexport interface VersionInfo {\n /** The SDK version (semver). */\n sdk: string;\n /** The pdfcraft commit the viewer was built from. */\n pdfcraftRev: string;\n}\n\n/** Error codes. `TIMEOUT`, `DESTROYED` and `FETCH_FAILED` come from the wrapper; the rest from the viewer. */\nexport type ErrorCode =\n | \"BAD_REQUEST\"\n | \"UNKNOWN_METHOD\"\n | \"UNSUPPORTED_PROTOCOL\"\n | \"NOT_READY\"\n | \"NO_DOCUMENT\"\n | \"LOAD_FAILED\"\n | \"NEEDS_PASSWORD\"\n | \"WRONG_PASSWORD\"\n | \"NOT_PERMITTED\"\n | \"READ_ONLY\"\n | \"XFDF_INVALID\"\n | \"TOO_LARGE\"\n | \"BUSY\"\n | \"INTERNAL\"\n | \"TIMEOUT\"\n | \"DESTROYED\"\n | \"FETCH_FAILED\";\n\n/** An error as data: what events carry. */\nexport interface ErrorInfo {\n /** Machine-readable code. */\n code: ErrorCode;\n /** Human-readable message (English). */\n message: string;\n}\n\n/** Every failure of the SDK: a typed code and a message. */\nexport class FreePdfError extends Error implements ErrorInfo {\n /** Machine-readable code. */\n readonly code: ErrorCode;\n\n /**\n * @param code - Machine-readable code.\n * @param message - Human-readable message.\n */\n constructor(code: ErrorCode, message: string) {\n super(message);\n this.name = \"FreePdfError\";\n this.code = code;\n }\n}\n\n/** Events and the data each one carries. */\nexport interface EventMap {\n /** The viewer is configured and ready for requests. */\n ready: VersionInfo;\n /** A document opened. */\n documentLoaded: DocumentInfo;\n /** A document could not be opened. */\n documentError: ErrorInfo;\n /** Comments were added, changed or removed (by the user or the API). */\n annotationsChanged: { count: number };\n /** The document gained or lost unsaved changes. */\n dirtyChanged: { dirty: boolean };\n /** Something failed outside a request (for example a wrong `password` at load). */\n error: ErrorInfo;\n /** The user pressed Save in the viewer: here is the saved PDF. The viewer treats it as saved. */\n saveRequested: { name: string; saveAs: boolean; data: Uint8Array };\n}\n\n/** An event name. */\nexport type EventName = keyof EventMap;\n\n/** A listener for event `K`. */\nexport type Listener<K extends EventName> = (data: EventMap[K]) => void;\n\n/** A mounted viewer. Every method is async and rejects with {@link FreePdfError}. */\nexport interface FreePdfViewer {\n /** Opens a document, replacing the one shown. */\n load(document: DocumentSource, options?: { password?: string }): Promise<LoadResult>;\n /** Lifts owner restrictions with the owner password; resolves to the new permissions. */\n unlock(password: string): Promise<Permissions>;\n /** What the open document's security allows. */\n getPermissions(): Promise<Permissions>;\n /** Imports comments from standard XFDF; `replace` deletes the existing ones first. Resolves to the number imported. */\n importXfdf(xfdf: string | Blob, options?: { replace?: boolean }): Promise<number>;\n /** The document's comments as XFDF (author in `title`). */\n exportXfdf(): Promise<string>;\n /** The document's comments with their replies; the length is the exact count. */\n getAnnotations(): Promise<Annotation[]>;\n /** Deletes every comment (one undo step per comment); resolves to how many there were. */\n deleteAllAnnotations(): Promise<number>;\n /** Sets the author of new comments. */\n setAuthor(author: string): Promise<void>;\n /** Sets the colour theme. */\n setTheme(theme: Theme): Promise<void>;\n /** Switches mode; your feature overrides still apply on top of it. */\n setMode(mode: Mode): Promise<void>;\n /** Replaces the feature overrides (relative to the mode). Pass `{}` to use the mode's features as they are. */\n setFeatures(features: FeatureFlags): Promise<void>;\n /** Changes interface options; options you leave out keep their value. */\n setUi(ui: UiOptions): Promise<void>;\n /** The resolved configuration: mode, every feature on or off, interface options. */\n getConfig(): Promise<ViewerConfig>;\n /** Hides parts of the interface (replaces the previous list). */\n setDisabledElements(ids: ElementId[]): Promise<void>;\n /** Sets the interface language; resolves to the language used. */\n setLocale(locale: string): Promise<string>;\n /** Number of pages. */\n getPageCount(): Promise<number>;\n /** Shows page `page` (1-based). */\n goToPage(page: number): Promise<void>;\n /** Sets the zoom: a percentage, `fit-width` or `fit-page`. */\n setZoom(zoom: Zoom): Promise<void>;\n /** Whether there are unsaved changes. */\n isDirty(): Promise<boolean>;\n /** The PDF with every change (comments included); the viewer then treats it as saved. */\n save(): Promise<Uint8Array>;\n /** Versions of the SDK and pdfcraft. */\n version(): Promise<VersionInfo>;\n /** Removes the viewer; pending requests reject with `DESTROYED`. Safe to call twice. */\n destroy(): Promise<void>;\n /** Adds a listener. */\n on<K extends EventName>(name: K, listener: Listener<K>): void;\n /** Removes a listener. */\n off<K extends EventName>(name: K, listener: Listener<K>): void;\n /** The iframe holding the viewer. */\n readonly iframe: HTMLIFrameElement;\n}\n\nconst HELLO_TIMEOUT_MS = 30_000;\nconst DEFAULT_TIMEOUT_MS = 60_000;\n\ninterface Pending {\n resolve: (value: unknown) => void;\n reject: (error: FreePdfError) => void;\n timer: ReturnType<typeof setTimeout>;\n}\n\ntype AnyListener = (data: never) => void;\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null;\n}\n\nfunction asErrorInfo(v: unknown): ErrorInfo {\n if (isRecord(v) && typeof v.code === \"string\" && typeof v.message === \"string\") {\n return { code: v.code as ErrorCode, message: v.message };\n }\n return { code: \"INTERNAL\", message: \"malformed error from the viewer\" };\n}\n\n/** A plain copy of interface options (a reactive proxy can't be posted to the iframe). */\nfunction plainUi(ui: UiOptions): Record<string, unknown> {\n const out: Record<string, unknown> = { ...ui };\n if (ui.panels) out.panels = { ...ui.panels };\n return out;\n}\n\nfunction channelId(): string {\n const bytes = new Uint8Array(16);\n crypto.getRandomValues(bytes);\n return Array.from(bytes, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction nameFromUrl(url: string): string {\n try {\n const last = new URL(url, location.href).pathname.split(\"/\").filter(Boolean).pop();\n return last ? decodeURIComponent(last) : \"document.pdf\";\n } catch {\n return \"document.pdf\";\n }\n}\n\n/** Copies the document's bytes into a fresh ArrayBuffer (safe to transfer). A URL is fetched within `timeoutMs`. */\nasync function readDocument(source: DocumentSource, timeoutMs: number): Promise<{ name: string; bytes: ArrayBuffer }> {\n if (\"url\" in source) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), timeoutMs);\n const callerSignal = source.fetchInit?.signal;\n const onAbort = (): void => controller.abort();\n callerSignal?.addEventListener(\"abort\", onAbort, { once: true });\n if (callerSignal?.aborted) controller.abort();\n try {\n const response = await fetch(source.url, { ...source.fetchInit, signal: controller.signal });\n if (!response.ok) throw new FreePdfError(\"FETCH_FAILED\", `could not fetch the document: HTTP ${response.status}`);\n return { name: source.name ?? nameFromUrl(source.url), bytes: await response.arrayBuffer() };\n } catch (e) {\n if (e instanceof FreePdfError) throw e;\n const why = controller.signal.aborted && !callerSignal?.aborted ? `no response in ${timeoutMs} ms` : String(e);\n throw new FreePdfError(\"FETCH_FAILED\", `could not fetch the document: ${why}`);\n } finally {\n clearTimeout(timer);\n callerSignal?.removeEventListener(\"abort\", onAbort);\n }\n }\n const data = source.data;\n if (data instanceof Blob) {\n const fileName = typeof File !== \"undefined\" && data instanceof File ? data.name : undefined;\n return { name: source.name ?? fileName ?? \"document.pdf\", bytes: await data.arrayBuffer() };\n }\n if (data instanceof ArrayBuffer) return { name: source.name ?? \"document.pdf\", bytes: data.slice(0) };\n if (data instanceof Uint8Array) {\n const copy = new Uint8Array(data.byteLength);\n copy.set(data);\n return { name: source.name ?? \"document.pdf\", bytes: copy.buffer };\n }\n throw new FreePdfError(\"BAD_REQUEST\", \"document needs a url or data (ArrayBuffer, Uint8Array or Blob)\");\n}\n\n/** The built-in loader: a ring that turns (slower when the user asks for reduced motion). */\nconst DEFAULT_LOADER_SVG =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 48 48\"><style>' +\n \"circle{fill:none;stroke-width:4;stroke-linecap:round}.t{stroke:rgba(128,128,136,.25)}\" +\n \".a{stroke:rgb(128,128,136);stroke-dasharray:30 200;transform-origin:24px 24px;animation:s .9s linear infinite}\" +\n \"@keyframes s{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.a{animation-duration:3s}}\" +\n '</style><circle class=\"t\" cx=\"24\" cy=\"24\" r=\"18\"/><circle class=\"a\" cx=\"24\" cy=\"24\" r=\"18\"/></svg>';\n\n/** Inline SVG markup is at most this long. */\nconst MAX_LOADER_SVG = 1024 * 1024;\n\n/** The loader as a plain, checked description (throws `BAD_REQUEST`), or `null` for none. */\nfunction loaderOptions(loader: Loader | false | undefined): LoaderOptions | null {\n if (loader === false) return null;\n if (loader === undefined) return { svg: DEFAULT_LOADER_SVG };\n if (typeof loader === \"string\") return { src: loader };\n if (!isRecord(loader)) throw new FreePdfError(\"BAD_REQUEST\", \"loader must be a URL, an object or false\");\n const out: LoaderOptions = {};\n for (const key of [\"src\", \"svg\", \"size\", \"background\", \"label\"] as const) {\n const v = loader[key];\n if (v === undefined) continue;\n if (typeof v !== \"string\") throw new FreePdfError(\"BAD_REQUEST\", `loader.${key} must be a string`);\n out[key] = v;\n }\n if (out.svg !== undefined && out.svg.length > MAX_LOADER_SVG) throw new FreePdfError(\"TOO_LARGE\", \"loader.svg is over 1 MiB\");\n if (out.src === undefined && out.svg === undefined) out.svg = DEFAULT_LOADER_SVG;\n return out;\n}\n\n/** The viewer's own background before it paints, so the loader matches it. */\nfunction themeBackground(theme: Theme): string {\n const dark = theme === \"dark\" || (theme === \"system\" && typeof matchMedia === \"function\" && matchMedia(\"(prefers-color-scheme: dark)\").matches);\n return dark ? \"#19191c\" : \"#f1f1f3\";\n}\n\n/** Builds the loader overlay (visible). */\nfunction loaderElement(options: LoaderOptions, theme: Theme): HTMLDivElement {\n const overlay = document.createElement(\"div\");\n overlay.setAttribute(\"role\", \"status\");\n overlay.dataset.fpsLoader = \"\";\n overlay.style.cssText = \"position:absolute;inset:0;display:flex;align-items:center;justify-content:center;transition:opacity .2s ease;\";\n overlay.style.background = options.background ?? themeBackground(theme);\n const img = document.createElement(\"img\");\n // An <img>: an SVG shown this way can't run scripts or load other resources.\n img.src = options.src ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(options.svg ?? DEFAULT_LOADER_SVG)}`;\n img.alt = options.label ?? \"Loading\";\n img.decoding = \"async\";\n img.style.cssText = \"display:block;height:auto;max-width:80%;max-height:80%;\";\n img.style.width = options.size ?? \"48px\";\n overlay.appendChild(img);\n return overlay;\n}\n\nclass Viewer implements FreePdfViewer {\n readonly iframe: HTMLIFrameElement;\n /** Holds the iframe and the loader; what the viewer adds to the host's element. */\n private readonly root: HTMLDivElement;\n private readonly loader: HTMLDivElement | null;\n /** Work the loader is shown for (starting counts as one). */\n private busy = 1;\n private readonly origin: string;\n private readonly channel = channelId();\n private readonly pending = new Map<number, Pending>();\n private readonly listeners = new Map<EventName, Set<AnyListener>>();\n private readonly timeoutMs: number;\n private nextId = 1;\n private destroyed = false;\n private hello: { resolve: (info: VersionInfo) => void; reject: (e: FreePdfError) => void } | null = null;\n private readyInfo: VersionInfo | null = null;\n private readonly onMessage = (event: MessageEvent): void => this.receive(event);\n\n constructor(element: HTMLElement, baseUrl: URL, timeoutMs: number, loader: LoaderOptions | null, theme: Theme) {\n this.origin = baseUrl.origin;\n this.timeoutMs = timeoutMs;\n this.root = document.createElement(\"div\");\n this.root.style.cssText = \"position:relative;width:100%;height:100%;\";\n this.iframe = document.createElement(\"iframe\");\n this.iframe.src = new URL(`viewer/index.html#ch=${this.channel}`, baseUrl).href;\n this.iframe.title = \"PDF viewer\";\n this.iframe.setAttribute(\"allow\", \"clipboard-read; clipboard-write; fullscreen\");\n this.iframe.style.cssText = \"display:block;width:100%;height:100%;border:0;\";\n this.root.appendChild(this.iframe);\n this.loader = loader ? loaderElement(loader, theme) : null;\n if (this.loader) this.root.appendChild(this.loader);\n window.addEventListener(\"message\", this.onMessage);\n element.appendChild(this.root);\n }\n\n /** Shows the loader for a piece of work; pair with {@link idle}. */\n busyStart(): void {\n this.busy++;\n if (this.loader) {\n this.loader.hidden = false;\n this.loader.style.opacity = \"1\";\n this.loader.style.pointerEvents = \"\";\n }\n }\n\n /** Ends a piece of work; the loader fades out when none is left. */\n idle(): void {\n this.busy = Math.max(0, this.busy - 1);\n const loader = this.loader;\n if (!loader || this.busy > 0) return;\n // Clicks reach the viewer at once, not only when the fade is over.\n loader.style.opacity = \"0\";\n loader.style.pointerEvents = \"none\";\n setTimeout(() => {\n if (this.busy === 0) loader.hidden = true;\n }, 200);\n }\n\n /** Waits for the viewer's hello. */\n started(): Promise<VersionInfo> {\n return new Promise<VersionInfo>((resolve, reject) => {\n const timer = setTimeout(() => {\n this.hello = null;\n reject(new FreePdfError(\"TIMEOUT\", \"the viewer did not start (is baseUrl right, and WebGL available?)\"));\n }, HELLO_TIMEOUT_MS);\n this.hello = {\n resolve: (info) => {\n clearTimeout(timer);\n resolve(info);\n },\n reject: (e) => {\n clearTimeout(timer);\n reject(e);\n },\n };\n });\n }\n\n private receive(event: MessageEvent): void {\n if (event.origin !== this.origin || event.source !== this.iframe.contentWindow) return;\n const msg: unknown = event.data;\n if (!isRecord(msg) || msg.ch !== this.channel) return;\n if (msg.fps !== PROTOCOL_VERSION) {\n // Another protocol version: fail what is waiting for it now, not after a timeout.\n const err = new FreePdfError(\"UNSUPPORTED_PROTOCOL\", `the viewer speaks protocol ${String(msg.fps)}; this wrapper speaks ${PROTOCOL_VERSION}`);\n if (msg.kind === \"hello\" && this.hello) {\n this.hello.reject(err);\n this.hello = null;\n return;\n }\n const p = msg.kind === \"res\" && typeof msg.id === \"number\" ? this.pending.get(msg.id) : undefined;\n if (p && typeof msg.id === \"number\") {\n this.pending.delete(msg.id);\n clearTimeout(p.timer);\n p.reject(err);\n return;\n }\n this.emit(\"error\", { code: err.code, message: err.message });\n return;\n }\n switch (msg.kind) {\n case \"hello\": {\n const info = isRecord(msg.info) ? msg.info : {};\n const version: VersionInfo = { sdk: String(info.sdk ?? \"\"), pdfcraftRev: String(info.pdfcraftRev ?? \"\") };\n if (version.sdk !== SDK_VERSION) {\n console.warn(`Free PDF SDK: the wrapper is ${SDK_VERSION} but the viewer is ${version.sdk}; serve matching files`);\n }\n this.hello?.resolve(version);\n this.hello = null;\n return;\n }\n case \"res\": {\n if (typeof msg.id !== \"number\") return;\n const p = this.pending.get(msg.id);\n if (!p) return;\n this.pending.delete(msg.id);\n clearTimeout(p.timer);\n if (msg.ok === true) p.resolve(msg.result);\n else {\n const e = asErrorInfo(msg.error);\n p.reject(new FreePdfError(e.code, e.message));\n }\n return;\n }\n case \"evt\": {\n if (typeof msg.name !== \"string\") return;\n if (msg.name === \"error\" && this.hello) {\n const e = asErrorInfo(msg.data);\n this.hello.reject(new FreePdfError(e.code, e.message));\n this.hello = null;\n return;\n }\n if (msg.name === \"documentError\" || msg.name === \"error\") {\n this.emit(msg.name, asErrorInfo(msg.data));\n } else if (this.listeners.has(msg.name as EventName)) {\n this.emit(msg.name as EventName, msg.data as never);\n }\n return;\n }\n default:\n return;\n }\n }\n\n emit<K extends EventName>(name: K, data: EventMap[K]): void {\n if (name === \"ready\") this.readyInfo = data as VersionInfo;\n for (const listener of [...(this.listeners.get(name) ?? [])]) {\n try {\n (listener as Listener<K>)(data);\n } catch (e) {\n console.error(`Free PDF SDK: a ${name} listener threw`, e);\n }\n }\n }\n\n request<T>(method: string, params?: Record<string, unknown>, transfer: Transferable[] = [], timeoutMs = this.timeoutMs): Promise<T> {\n if (this.destroyed) return Promise.reject(new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\"));\n const contentWindow = this.iframe.contentWindow;\n if (!contentWindow) return Promise.reject(new FreePdfError(\"NOT_READY\", \"the viewer is not attached to the page\"));\n const id = this.nextId;\n this.nextId = this.nextId >= 0x7fffffff ? 1 : this.nextId + 1;\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(() => {\n this.pending.delete(id);\n reject(new FreePdfError(\"TIMEOUT\", `${method} got no reply in ${timeoutMs} ms`));\n }, timeoutMs);\n this.pending.set(id, { resolve: resolve as (v: unknown) => void, reject, timer });\n // The viewer drops the request once the deadline has passed, so a request that timed out\n // here never takes effect later (frames stall in background tabs).\n const deadline = Date.now() + timeoutMs;\n try {\n contentWindow.postMessage({ fps: PROTOCOL_VERSION, ch: this.channel, kind: \"req\", id, method, params: params ?? {}, deadline }, this.origin, transfer);\n } catch (e) {\n clearTimeout(timer);\n this.pending.delete(id);\n reject(new FreePdfError(\"BAD_REQUEST\", `${method} could not be sent: ${e instanceof Error ? e.message : String(e)}`));\n }\n });\n }\n\n async load(source: DocumentSource, options?: { password?: string }): Promise<LoadResult> {\n if (this.destroyed) throw new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\");\n this.busyStart();\n try {\n let doc: { name: string; bytes: ArrayBuffer };\n try {\n doc = await readDocument(source, this.timeoutMs * 2);\n } catch (e) {\n // The viewer reports its own load failures; a fetch that failed never reached it.\n const err = e instanceof FreePdfError ? e : new FreePdfError(\"FETCH_FAILED\", String(e));\n this.emit(\"documentError\", { code: err.code, message: err.message });\n throw err;\n }\n const { name, bytes } = doc;\n const params: Record<string, unknown> = { name, data: bytes };\n if (options?.password !== undefined) params.password = options.password;\n return await this.request<LoadResult>(\"load\", params, [bytes], this.timeoutMs * 2);\n } finally {\n this.idle();\n }\n }\n\n async unlock(password: string): Promise<Permissions> {\n const r = await this.request<{ permissions: Permissions }>(\"unlock\", { password });\n return r.permissions;\n }\n\n getPermissions(): Promise<Permissions> {\n return this.request<Permissions>(\"getPermissions\");\n }\n\n async importXfdf(xfdf: string | Blob, options?: { replace?: boolean }): Promise<number> {\n const text = typeof xfdf === \"string\" ? xfdf : await xfdf.text();\n return this.request<number>(\"importXfdf\", { xfdf: text, replace: options?.replace ?? false });\n }\n\n exportXfdf(): Promise<string> {\n return this.request<string>(\"exportXfdf\");\n }\n\n getAnnotations(): Promise<Annotation[]> {\n return this.request<Annotation[]>(\"getAnnotations\");\n }\n\n deleteAllAnnotations(): Promise<number> {\n return this.request<number>(\"deleteAllAnnotations\");\n }\n\n async setAuthor(author: string): Promise<void> {\n await this.request(\"setAuthor\", { author });\n }\n\n async setTheme(theme: Theme): Promise<void> {\n await this.request(\"setTheme\", { theme });\n }\n\n async setMode(mode: Mode): Promise<void> {\n await this.request(\"setMode\", { mode });\n }\n\n async setFeatures(features: FeatureFlags): Promise<void> {\n await this.request(\"setFeatures\", { features: { ...features } });\n }\n\n async setUi(ui: UiOptions): Promise<void> {\n await this.request(\"setUi\", { ui: plainUi(ui) });\n }\n\n getConfig(): Promise<ViewerConfig> {\n return this.request<ViewerConfig>(\"getConfig\");\n }\n\n async setDisabledElements(ids: ElementId[]): Promise<void> {\n await this.request(\"setDisabledElements\", { ids: [...ids] });\n }\n\n async setLocale(locale: string): Promise<string> {\n const r = await this.request<{ locale: string }>(\"setLocale\", { locale });\n return r.locale;\n }\n\n getPageCount(): Promise<number> {\n return this.request<number>(\"getPageCount\");\n }\n\n async goToPage(page: number): Promise<void> {\n await this.request(\"goToPage\", { page });\n }\n\n async setZoom(zoom: Zoom): Promise<void> {\n await this.request(\"setZoom\", { zoom });\n }\n\n isDirty(): Promise<boolean> {\n return this.request<boolean>(\"isDirty\");\n }\n\n async save(): Promise<Uint8Array> {\n return this.request<Uint8Array>(\"save\", undefined, [], this.timeoutMs * 2);\n }\n\n version(): Promise<VersionInfo> {\n return this.request<VersionInfo>(\"version\");\n }\n\n async destroy(): Promise<void> {\n if (this.destroyed) return;\n this.destroyed = true;\n window.removeEventListener(\"message\", this.onMessage);\n const error = new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\");\n for (const p of this.pending.values()) {\n clearTimeout(p.timer);\n p.reject(error);\n }\n this.pending.clear();\n this.hello?.reject(error);\n this.hello = null;\n this.listeners.clear();\n this.root.remove();\n }\n\n on<K extends EventName>(name: K, listener: Listener<K>): void {\n let set = this.listeners.get(name);\n if (!set) {\n set = new Set();\n this.listeners.set(name, set);\n }\n set.add(listener as AnyListener);\n if (name === \"ready\" && this.readyInfo) {\n const info = this.readyInfo;\n queueMicrotask(() => {\n if (this.listeners.get(name)?.has(listener as AnyListener)) (listener as Listener<\"ready\">)(info);\n });\n }\n }\n\n off<K extends EventName>(name: K, listener: Listener<K>): void {\n this.listeners.get(name)?.delete(listener as AnyListener);\n }\n}\n\n/**\n * Mounts a viewer in `element` (which it fills) and resolves once it is ready and, if\n * `options.document` is given, once that document is open. Rejects with {@link FreePdfError}\n * (and removes the iframe) when the viewer cannot start or the document cannot be opened.\n *\n * @param element - The element to mount the viewer in; give it a size.\n * @param options - Where the SDK is hosted, and how the viewer starts.\n */\nexport async function init(element: HTMLElement, options: InitOptions): Promise<FreePdfViewer> {\n if (!(element instanceof HTMLElement)) throw new FreePdfError(\"BAD_REQUEST\", \"init needs an element to mount the viewer in\");\n if (!options || typeof options.baseUrl !== \"string\") throw new FreePdfError(\"BAD_REQUEST\", \"init needs options.baseUrl\");\n const base = new URL(options.baseUrl.endsWith(\"/\") ? options.baseUrl : `${options.baseUrl}/`, document.baseURI);\n if (base.origin !== location.origin) {\n throw new FreePdfError(\"BAD_REQUEST\", `the SDK must be served from this page's origin (${location.origin}), not ${base.origin}`);\n }\n const theme = options.theme ?? \"system\";\n const viewer = new Viewer(element, base, options.timeoutMs ?? DEFAULT_TIMEOUT_MS, loaderOptions(options.loader), theme);\n for (const [name, listener] of Object.entries(options.listeners ?? {})) {\n if (typeof listener === \"function\") viewer.on(name as EventName, listener as Listener<EventName>);\n }\n try {\n const info = await viewer.started();\n // Plain copies: a reactive proxy (Vue) can't be posted to the iframe.\n const config: Record<string, unknown> = {\n mode: options.mode ?? \"view\",\n theme,\n disabledElements: [...(options.disabledElements ?? [])],\n };\n if (options.features !== undefined) config.features = { ...options.features };\n if (options.ui !== undefined) config.ui = plainUi(options.ui);\n if (options.author !== undefined) config.author = options.author;\n if (options.locale !== undefined) config.locale = options.locale;\n await viewer.request(\"configure\", config);\n viewer.emit(\"ready\", info);\n if (options.document) {\n await viewer.load(options.document, options.password === undefined ? undefined : { password: options.password });\n }\n viewer.idle();\n return viewer;\n } catch (e) {\n await viewer.destroy();\n throw e instanceof FreePdfError ? e : new FreePdfError(\"INTERNAL\", String(e));\n }\n}\n\n/** The SDK entry point. */\nexport const FreePdf = {\n /** See {@link init}. */\n init,\n /** The wrapper's version. */\n version: SDK_VERSION,\n} as const;\n\nexport default FreePdf;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mecorelabs/free-pdf-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Free PDF SDK: an embeddable, white-label PDF viewer, annotator and editor for the web, with React, Vue, Svelte, Angular and Web Component integrations",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"homepage": "https://freepdfsdk.mecorelabs.com",
|
package/third-party/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Third-party notices
|
|
2
2
|
|
|
3
3
|
Free PDF SDK is built on [pdfcraft](https://github.com/storytold/pdfcraft) by the ArtCraft Team
|
|
4
|
-
and the PdfCraft contributors (MIT OR Apache-2.0), at upstream commit `
|
|
4
|
+
and the PdfCraft contributors (MIT OR Apache-2.0), at upstream commit `0dc77fe4ed8810b9e9f25b9dd050afae662c062a`.
|
|
5
5
|
Free PDF SDK modifies pdfcraft's interface crate (pdfcraft-ui-egui) with opt-in hooks for
|
|
6
|
-
white-label branding and for hiding features; the modified build is `
|
|
6
|
+
white-label branding and for hiding features; the modified build is `9109e4f0c4ddc30e4c130180138aee28756f8201`
|
|
7
7
|
(`pdfcraftRev` in `version.json`). The viewer's .wasm embeds the material below; each
|
|
8
8
|
licence is in this folder. Generated by `scripts/collect-notices.mjs` — do not edit by hand.
|
|
9
9
|
|
package/third-party/crates.md
CHANGED
|
@@ -205,36 +205,36 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
|
|
|
205
205
|
| parking_lot_core | 0.9.12 | MIT OR Apache-2.0 |
|
|
206
206
|
| pastey | 0.2.3 | MIT OR Apache-2.0 |
|
|
207
207
|
| pbkdf2 | 0.13.0 | MIT OR Apache-2.0 |
|
|
208
|
-
| pdfcraft-a11y | 0.
|
|
209
|
-
| pdfcraft-annot | 0.
|
|
210
|
-
| pdfcraft-audit | 0.
|
|
211
|
-
| pdfcraft-compare | 0.
|
|
212
|
-
| pdfcraft-content | 0.
|
|
213
|
-
| pdfcraft-cos | 0.
|
|
214
|
-
| pdfcraft-create | 0.
|
|
215
|
-
| pdfcraft-crypt | 0.
|
|
216
|
-
| pdfcraft-edit | 0.
|
|
217
|
-
| pdfcraft-engine | 0.
|
|
218
|
-
| pdfcraft-export | 0.
|
|
219
|
-
| pdfcraft-filters | 0.
|
|
220
|
-
| pdfcraft-fonts | 0.
|
|
221
|
-
| pdfcraft-forms | 0.
|
|
222
|
-
| pdfcraft-geom | 0.
|
|
223
|
-
| pdfcraft-js | 0.
|
|
224
|
-
| pdfcraft-measure | 0.
|
|
225
|
-
| pdfcraft-model | 0.
|
|
226
|
-
| pdfcraft-ocr | 0.
|
|
227
|
-
| pdfcraft-optimize | 0.
|
|
228
|
-
| pdfcraft-organize | 0.
|
|
229
|
-
| pdfcraft-platform | 0.
|
|
230
|
-
| pdfcraft-preflight | 0.
|
|
231
|
-
| pdfcraft-print | 0.
|
|
232
|
-
| pdfcraft-redact | 0.
|
|
233
|
-
| pdfcraft-render | 0.
|
|
234
|
-
| pdfcraft-sign | 0.
|
|
235
|
-
| pdfcraft-ui-egui | 0.
|
|
236
|
-
| pdfcraft-xfa | 0.
|
|
237
|
-
| pdfcraft-xfdf | 0.
|
|
208
|
+
| pdfcraft-a11y | 0.13.0 | MIT OR Apache-2.0 |
|
|
209
|
+
| pdfcraft-annot | 0.13.0 | MIT OR Apache-2.0 |
|
|
210
|
+
| pdfcraft-audit | 0.13.0 | MIT OR Apache-2.0 |
|
|
211
|
+
| pdfcraft-compare | 0.13.0 | MIT OR Apache-2.0 |
|
|
212
|
+
| pdfcraft-content | 0.13.0 | MIT OR Apache-2.0 |
|
|
213
|
+
| pdfcraft-cos | 0.13.0 | MIT OR Apache-2.0 |
|
|
214
|
+
| pdfcraft-create | 0.13.0 | MIT OR Apache-2.0 |
|
|
215
|
+
| pdfcraft-crypt | 0.13.0 | MIT OR Apache-2.0 |
|
|
216
|
+
| pdfcraft-edit | 0.13.0 | MIT OR Apache-2.0 |
|
|
217
|
+
| pdfcraft-engine | 0.13.0 | MIT OR Apache-2.0 |
|
|
218
|
+
| pdfcraft-export | 0.13.0 | MIT OR Apache-2.0 |
|
|
219
|
+
| pdfcraft-filters | 0.13.0 | MIT OR Apache-2.0 |
|
|
220
|
+
| pdfcraft-fonts | 0.13.0 | MIT OR Apache-2.0 |
|
|
221
|
+
| pdfcraft-forms | 0.13.0 | MIT OR Apache-2.0 |
|
|
222
|
+
| pdfcraft-geom | 0.13.0 | MIT OR Apache-2.0 |
|
|
223
|
+
| pdfcraft-js | 0.13.0 | MIT OR Apache-2.0 |
|
|
224
|
+
| pdfcraft-measure | 0.13.0 | MIT OR Apache-2.0 |
|
|
225
|
+
| pdfcraft-model | 0.13.0 | MIT OR Apache-2.0 |
|
|
226
|
+
| pdfcraft-ocr | 0.13.0 | MIT OR Apache-2.0 |
|
|
227
|
+
| pdfcraft-optimize | 0.13.0 | MIT OR Apache-2.0 |
|
|
228
|
+
| pdfcraft-organize | 0.13.0 | MIT OR Apache-2.0 |
|
|
229
|
+
| pdfcraft-platform | 0.13.0 | MIT OR Apache-2.0 |
|
|
230
|
+
| pdfcraft-preflight | 0.13.0 | MIT OR Apache-2.0 |
|
|
231
|
+
| pdfcraft-print | 0.13.0 | MIT OR Apache-2.0 |
|
|
232
|
+
| pdfcraft-redact | 0.13.0 | MIT OR Apache-2.0 |
|
|
233
|
+
| pdfcraft-render | 0.13.0 | MIT OR Apache-2.0 |
|
|
234
|
+
| pdfcraft-sign | 0.13.0 | MIT OR Apache-2.0 |
|
|
235
|
+
| pdfcraft-ui-egui | 0.13.0 | MIT OR Apache-2.0 |
|
|
236
|
+
| pdfcraft-xfa | 0.13.0 | MIT OR Apache-2.0 |
|
|
237
|
+
| pdfcraft-xfdf | 0.13.0 | MIT OR Apache-2.0 |
|
|
238
238
|
| pem-rfc7468 | 1.0.0 | Apache-2.0 OR MIT |
|
|
239
239
|
| peniko | 0.6.1 | Apache-2.0 OR MIT |
|
|
240
240
|
| percent-encoding | 2.3.2 | MIT OR Apache-2.0 |
|
|
@@ -4,30 +4,37 @@
|
|
|
4
4
|
|
|
5
5
|
Every asset PdfCraft includes, bundles or uses to build its published material, with its author, source and licence. The policy is in [AGENTS.md](AGENTS.md) §1. The machine-readable list, with SHA-256 hashes, is [ATTRIBUTION.toml](ATTRIBUTION.toml). Licence texts are kept beside the assets and summarised in [NOTICE](NOTICE).
|
|
6
6
|
|
|
7
|
-
## In this repository (
|
|
7
|
+
## In this repository (288)
|
|
8
8
|
|
|
9
9
|
| Asset | Title | Author | Licence | Source | Used for |
|
|
10
10
|
|---|---|---|---|---|---|
|
|
11
|
-
| `crates/ui-egui/src/i18n/el.tsv` | Greek interface translation catalog | Camthalion77 and contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft English UI labels | Greek UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
12
|
-
| `crates/ui-egui/src/i18n/zh-hans.tsv` | Simplified Chinese interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources | Simplified Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
13
|
-
| `crates/ui-egui/src/i18n/zh-hant.tsv` | Traditional Chinese (Taiwan) interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources | Traditional Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
14
|
-
| `crates/ui-egui/src/i18n/cs.tsv` | Czech interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources | Czech UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
15
|
-
| `crates/ui-egui/src/i18n/pt-br.tsv` | Brazilian Portuguese interface translation catalog | André Cardoso (andrecards), PdfCraft contributors | MIT OR Apache-2.0 | Clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources: the ~1,826-entry gist posted in issue #288 (https://gist.github.com/andrecards/ac388c25fba17312ce83207f8b7b467e), completed and reviewed by PdfCraft contributors | Brazilian Portuguese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
16
|
-
| `crates/ui-egui/src/i18n/es.tsv` | Spanish interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources | Spanish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
17
|
-
| `crates/ui-egui/src/i18n/fr.tsv` | French interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources | French UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
18
|
-
| `crates/ui-egui/src/i18n/de.tsv` | German interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources | German UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
19
|
-
| `crates/ui-egui/src/i18n/
|
|
20
|
-
| `crates/ui-egui/src/i18n/
|
|
21
|
-
| `crates/ui-egui/src/i18n/
|
|
22
|
-
| `crates/ui-egui/src/i18n/
|
|
23
|
-
| `crates/ui-egui/src/i18n/
|
|
24
|
-
| `crates/ui-egui/src/i18n/
|
|
25
|
-
| `crates/ui-egui/src/i18n/
|
|
26
|
-
| `crates/ui-egui/src/i18n/
|
|
27
|
-
| `crates/ui-egui/src/i18n/
|
|
28
|
-
| `crates/ui-egui/src/i18n/
|
|
29
|
-
| `crates/ui-egui/src/i18n/
|
|
30
|
-
| `crates/ui-egui/src/i18n/
|
|
11
|
+
| `crates/ui-egui/src/i18n/el.tsv` | Greek interface translation catalog | Camthalion77 and contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft English UI labels; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Greek UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
12
|
+
| `crates/ui-egui/src/i18n/zh-hans.tsv` | Simplified Chinese interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Simplified Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
13
|
+
| `crates/ui-egui/src/i18n/zh-hant.tsv` | Traditional Chinese (Taiwan) interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Traditional Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
14
|
+
| `crates/ui-egui/src/i18n/cs.tsv` | Czech interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 signature-check and standard-identification wordings are contributor-original AI-assisted translations from English, not separately native-reviewed | Czech UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
15
|
+
| `crates/ui-egui/src/i18n/pt-br.tsv` | Brazilian Portuguese interface translation catalog | André Cardoso (andrecards), PdfCraft contributors | MIT OR Apache-2.0 | Clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources: the ~1,826-entry gist posted in issue #288 (https://gist.github.com/andrecards/ac388c25fba17312ce83207f8b7b467e), completed and reviewed by PdfCraft contributors; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 text-field-table limit messages are contributor-original AI-assisted translations from English, not separately native-reviewed | Brazilian Portuguese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
16
|
+
| `crates/ui-egui/src/i18n/es.tsv` | Spanish interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; the 2026-10-20 coverage additions are AI-assisted and not separately native-reviewed; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 signature-check wordings are contributor-original AI-assisted translations from English, not separately native-reviewed | Spanish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
17
|
+
| `crates/ui-egui/src/i18n/fr.tsv` | French interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | French UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
18
|
+
| `crates/ui-egui/src/i18n/de.tsv` | German interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | German UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
19
|
+
| `crates/ui-egui/src/i18n/lo.tsv` | Lao interface translation catalog | @bounkirdni-2025 | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft English UI labels, no proprietary localisation resources; 2026-10-22 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Lao UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
20
|
+
| `crates/ui-egui/src/i18n/te.tsv` | Telugu interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Telugu UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
21
|
+
| `crates/ui-egui/src/i18n/it.tsv` | Italian interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Italian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
22
|
+
| `crates/ui-egui/src/i18n/pl.tsv` | Polish interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 signature-check wordings are contributor-original AI-assisted translations from English, not separately native-reviewed | Polish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
23
|
+
| `crates/ui-egui/src/i18n/ru.tsv` | Russian interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Russian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
24
|
+
| `crates/ui-egui/src/i18n/hu.tsv` | Hungarian interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Hungarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
25
|
+
| `crates/ui-egui/src/i18n/bg.tsv` | Bulgarian interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Bulgarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
26
|
+
| `crates/ui-egui/src/i18n/kk.tsv` | Kazakh interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of the English UI labels into Kazakh, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Kazakh UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
27
|
+
| `crates/ui-egui/src/i18n/ja.tsv` | Japanese interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Japanese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
28
|
+
| `crates/ui-egui/src/i18n/uk.tsv` | Ukrainian interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Ukrainian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
29
|
+
| `crates/ui-egui/src/i18n/ar.tsv` | Arabic interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Arabic UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
30
|
+
| `crates/ui-egui/src/i18n/ckb.tsv` | Central Kurdish (Sorani) interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-22 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Central Kurdish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
31
|
+
| `crates/ui-egui/src/i18n/tr.tsv` | Turkish interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Turkish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
32
|
+
| `crates/ui-egui/src/i18n/lt.tsv` | Lithuanian interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels and user-facing messages; original catalog reviewed by a native Lithuanian-speaking contributor; 2026-10-15 coverage additions are AI-assisted and not separately native-reviewed; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Lithuanian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
33
|
+
| `crates/ui-egui/src/i18n/hi.tsv` | Hindi interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-22 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 text-field-table labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Hindi UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
34
|
+
| `crates/ui-egui/src/i18n/id.tsv` | Indonesian interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-22 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 text-field-table labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Indonesian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
35
|
+
| `crates/ui-egui/src/i18n/ko.tsv` | Korean interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-22 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 text-field-table labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Korean UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
36
|
+
| `crates/ui-egui/src/i18n/ro.tsv` | Romanian interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels and user-facing messages; AI-assisted and not yet reviewed line by line by a native Romanian speaker; 2026-10-22 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 text-field-table labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Romanian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
37
|
+
| `crates/ui-egui/src/i18n/fi.tsv` | Finnish interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: AI-assisted (Claude Code) clean-room translations of PdfCraft's English UI labels and user-facing messages; not yet proofread by a native Finnish speaker; 2026-10-22 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 text-field-table labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Finnish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
31
38
|
| `assets/icons/accessibility.svg` | Lucide icon "accessibility" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/accessibility.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
32
39
|
| `assets/icons/align-left.svg` | Lucide icon "align-left" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/align-left.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
33
40
|
| `assets/icons/align-center.svg` | Lucide icon "align-center" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/align-center.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
@@ -223,6 +230,7 @@ Every asset PdfCraft includes, bundles or uses to build its published material,
|
|
|
223
230
|
| `vendor/hayro-interpret/assets/FoxitSymbol.pfb` | FoxitSymbol (standard-14 substitute font) | Foxit Software Inc. / PDFium Authors | BSD-3-Clause | https://pdfium.googlesource.com/pdfium (via hayro-interpret 0.7.0 assets/) | Renders non-embedded standard-14 fonts (vendored hayro-interpret) |
|
|
224
231
|
| `vendor/hayro-interpret/assets/CGATS001Compat-v2-micro.icc` | CGATS001Compat v2 micro ICC profile | Clinton Ingram (saucecontrol/Compact-ICC-Profiles) | CC0-1.0 | https://github.com/saucecontrol/Compact-ICC-Profiles | Default CMYK colour conversion (vendored hayro-interpret) |
|
|
225
232
|
| `crates/fonts/src/std14_metrics.rs` | Standard-14 font advance widths and encodings (as Rust tables) | Adobe (Core14 AFM metrics, PDF specification encodings); tables generated by the PdfCraft contributors | MIT OR Apache-2.0 | ISO 32000-2 Annex D and the Adobe Core14 AFM metrics. Generated by joining the published WinAnsi, Symbol and ZapfDingbats encodings (code to glyph name) with the per-glyph advance widths, then spot-checked against the specification by hand in the tests of crates/fonts/src/std14.rs. Data only: the code that reads these tables lives in std14.rs, so that ordinary edits do not churn this file's hash. | Advance widths for the fourteen standard fonts, which a PDF may name without embedding. Non-visual data, not a typeface: the item AGENTS.md 1.1 permits, held first-party so generated appearance streams and the renderer agree. |
|
|
233
|
+
| `vendor/hayro-cmap/assets/cmaps.brotli` | Adobe CMap resources (predefined CJK CMaps) | Adobe | BSD-3-Clause | https://github.com/adobe-type-tools/cmap-resources (via hayro-cmap 0.1.0 assets/) | Character-code mapping tables required to read CJK PDFs. Non-visual data, allowed by AGENTS.md §1.1 |
|
|
226
234
|
| `docs/brand/artcraft-logo-white.png` | ArtCraft brand: artcraft-logo-white | ArtCraft Team | LicenseRef-Storyteller-Trademark | ArtCraft Team brand assets (provided by the project owner, 2026-10-01; identical copies in storytold/photocraft) | ArtCraft branding next to the community links (About dialog, Help menu, home screen) and in docs. ArtCraft Team trademark, not open source; may be used only unmodified within PdfCraft; forks and modified versions must remove it. |
|
|
227
235
|
| `docs/brand/artcraft-logo-white.svg` | ArtCraft brand: artcraft-logo-white | ArtCraft Team | LicenseRef-Storyteller-Trademark | ArtCraft Team brand assets (provided by the project owner, 2026-10-01; identical copies in storytold/photocraft) | ArtCraft branding next to the community links (About dialog, Help menu, home screen) and in docs. ArtCraft Team trademark, not open source; may be used only unmodified within PdfCraft; forks and modified versions must remove it. |
|
|
228
236
|
| `docs/brand/artcraft-logo.png` | ArtCraft brand: artcraft-logo | ArtCraft Team | LicenseRef-Storyteller-Trademark | ArtCraft Team brand assets (provided by the project owner, 2026-10-01; identical copies in storytold/photocraft) | ArtCraft branding next to the community links (About dialog, Help menu, home screen) and in docs. ArtCraft Team trademark, not open source; may be used only unmodified within PdfCraft; forks and modified versions must remove it. |
|
|
@@ -267,26 +275,29 @@ Every asset PdfCraft includes, bundles or uses to build its published material,
|
|
|
267
275
|
| `assets/icons/thumbs-down.svg` | Lucide icon "thumbs-down" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/thumbs-down.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
268
276
|
| `assets/icons/message-square-plus.svg` | Lucide icon "message-square-plus" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/message-square-plus.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
269
277
|
| `assets/icons/circle-x.svg` | Lucide icon "circle-x" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/circle-x.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
270
|
-
| `crates/ui-egui/tests/data/form.pdf` | One-page AcroForm test fixture (text, check box, radio group, combo box) | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: hand-written PDF objects, no third-party content | Form-filling UI tests (crates/ui-egui/tests/forms.rs, commands.rs) |
|
|
278
|
+
| `crates/ui-egui/tests/data/form.pdf` | One-page AcroForm test fixture (text, check box, radio group, combo box) | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: hand-written PDF objects, no third-party content | Form-filling UI tests (crates/ui-egui/tests/it/forms.rs, commands.rs) |
|
|
271
279
|
| `assets/icons/pentagon.svg` | Lucide icon "pentagon" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/pentagon.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
272
280
|
| `assets/icons/message-square-quote.svg` | Lucide icon "message-square-quote" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/message-square-quote.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
273
|
-
| `crates/sign/tests/data/openssl-signed.pdf` | One-page PDF signed with OpenSSL CMS (adbe.pkcs7.detached) by the RSA test key | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: hand-written PDF objects; signature made with `openssl cms -sign` over its byte ranges (see crates/sign/tests/data/README.md) | Signature validation tests (crates/sign/tests/pdf.rs): a signature PdfCraft did not make |
|
|
281
|
+
| `crates/sign/tests/data/openssl-signed.pdf` | One-page PDF signed with OpenSSL CMS (adbe.pkcs7.detached) by the RSA test key | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: hand-written PDF objects; signature made with `openssl cms -sign` over its byte ranges (see crates/sign/tests/data/README.md) | Signature validation tests (crates/sign/tests/it/pdf.rs): a signature PdfCraft did not make |
|
|
274
282
|
| `assets/icons/clipboard-paste.svg` | Lucide icon "clipboard-paste" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/clipboard-paste.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
275
283
|
| `assets/fonts/DancingScript.ttf` | Dancing Script (variable) | The Dancing Script Project Authors (Pablo Impallari) | OFL-1.1 | https://github.com/google/fonts/blob/9710da1eacb3be272583c3224dcb70f9da6eadbb/ofl/dancingscript/DancingScript%5Bwght%5D.ttf | Fill & Sign typed signatures and initials: the typed name's glyph outlines, drawn as filled paths (the font file itself is not embedded in PDFs) |
|
|
276
284
|
| `packaging/macos/dmg/background.svg` | PdfCraft macOS DMG window background | @XusBadia | MIT OR Apache-2.0 | Original work for this repository, derived from the PdfCraft app icon (assets/app-icon/pdfcraft.svg, referenced via an SVG image element, not copied) | Finder window of the macOS DMG; rendered to background.tiff by packaging/macos/dmg/generate.py |
|
|
277
285
|
| `packaging/macos/dmg/background.tiff` | PdfCraft macOS DMG window background (rendered) | @XusBadia | MIT OR Apache-2.0 | Rendered from packaging/macos/dmg/background.svg by packaging/macos/dmg/generate.py | 1x + 2x HiDPI 16-colour palette TIFF copied into the macOS DMG by packaging/macos/package.sh; includes the app icon and the free LittleCMS built-in sRGB profile |
|
|
278
|
-
| `crates/sign/tests/data/x509-rsa-sha1.pdf` | One-page PDF with a legacy adbe.x509.rsa_sha1 signature by the RSA test key | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: hand-written PDF objects; signature made with `openssl dgst -sha1 -sign` over its byte ranges (see crates/sign/tests/data/README.md) | Signature validation tests (crates/sign/tests/pdf.rs): the legacy adbe.x509.rsa_sha1 format |
|
|
286
|
+
| `crates/sign/tests/data/x509-rsa-sha1.pdf` | One-page PDF with a legacy adbe.x509.rsa_sha1 signature by the RSA test key | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: hand-written PDF objects; signature made with `openssl dgst -sha1 -sign` over its byte ranges (see crates/sign/tests/data/README.md) | Signature validation tests (crates/sign/tests/it/pdf.rs): the legacy adbe.x509.rsa_sha1 format |
|
|
279
287
|
| `assets/icons/monitor.svg` | Lucide icon "monitor" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/monitor.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
280
|
-
| `crates/ui-egui/src/i18n/vi.tsv` | Vietnamese interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels; PhotoCraft and VectorCraft Vietnamese catalogs used only as translation memory when English source and semantic context matched; original catalog reviewed by a native Vietnamese-speaking contributor; 2026-10-15 coverage additions are AI-assisted and not separately native-reviewed | Vietnamese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
281
|
-
| `crates/ui-egui/src/i18n/sl.tsv` | Slovene interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources | Slovene UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
288
|
+
| `crates/ui-egui/src/i18n/vi.tsv` | Vietnamese interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels; PhotoCraft and VectorCraft Vietnamese catalogs used only as translation memory when English source and semantic context matched; original catalog reviewed by a native Vietnamese-speaking contributor; 2026-10-15 coverage additions are AI-assisted and not separately native-reviewed; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 signature-check wordings are contributor-original AI-assisted translations from English, not separately native-reviewed | Vietnamese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
289
|
+
| `crates/ui-egui/src/i18n/sl.tsv` | Slovene interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-18 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Slovene UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
282
290
|
| `vendor/vello_common/assets/probe.png` | vello_common probe reference image (rendered from probe.rgba) | Linebender vello contributors | MIT OR Apache-2.0 | vello_common 0.0.8 (crates.io), vendored in vendor/vello_common; regenerated by its vello_sparse_tests regenerate_probe_reference binary | Reference picture of the vendored vello_common probe module, for people only; the build reads probe.rgba, not this file |
|
|
283
|
-
| `crates/ui-egui/src/i18n/nb.tsv` | Norwegian Bokmål interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources | Norwegian Bokmål UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
291
|
+
| `crates/ui-egui/src/i18n/nb.tsv` | Norwegian Bokmål interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-22 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Norwegian Bokmål UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
284
292
|
| `assets/icons/superscript.svg` | Lucide icon "superscript" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/superscript.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
285
293
|
| `assets/icons/subscript.svg` | Lucide icon "subscript" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/subscript.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
286
294
|
| `assets/icons/pilcrow.svg` | Lucide icon "pilcrow" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/pilcrow.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
287
295
|
| `assets/icons/move-horizontal.svg` | Lucide icon "move-horizontal" | Lucide Contributors (portions Cole Bemis, Feather) | ISC | https://github.com/lucide-icons/lucide (npm lucide-static 1.49.0, icons/move-horizontal.svg) | UI icon, embedded via crates/ui-egui/src/icon_data.rs |
|
|
296
|
+
| `crates/ui-egui/src/i18n/sq.tsv` | Albanian interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-22 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 signature-appearance labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 text-field-table labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Albanian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
297
|
+
| `crates/ui-egui/src/i18n/th.tsv` | Thai interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, no proprietary localisation resources; 2026-10-22 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Thai UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
298
|
+
| `crates/ui-egui/src/i18n/ca.tsv` | Catalan interface translation catalog | PdfCraft contributors | MIT OR Apache-2.0 | Contributor-original: clean-room translations of PdfCraft's English UI labels, written from their meaning; no proprietary localisation resources; 2026-10-22 page-gap labels are contributor-original AI-assisted translations from English, not separately native-reviewed; 2026-10-22 text-field-table labels are contributor-original AI-assisted translations from English, not separately native-reviewed | Catalan UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs |
|
|
288
299
|
|
|
289
|
-
## Compiled in through dependencies (
|
|
300
|
+
## Compiled in through dependencies (5)
|
|
290
301
|
|
|
291
302
|
| Crate | File | Title | Author | Licence | Source | Used for |
|
|
292
303
|
|---|---|---|---|---|---|---|
|
|
@@ -294,7 +305,6 @@ Every asset PdfCraft includes, bundles or uses to build its published material,
|
|
|
294
305
|
| `epaint_default_fonts` 0.36.2 | `fonts/Hack-Regular.ttf` | Hack Regular | Source Foundry Authors (derived from Bitstream Vera / DejaVu) | MIT AND Bitstream-Vera | https://github.com/source-foundry/Hack | egui fallback fonts (eframe feature default_fonts) |
|
|
295
306
|
| `epaint_default_fonts` 0.36.2 | `fonts/NotoEmoji-Regular.ttf` | Noto Emoji (monochrome) | Google Inc. | OFL-1.1 | https://github.com/googlefonts/noto-emoji | egui fallback fonts (eframe feature default_fonts) |
|
|
296
307
|
| `epaint_default_fonts` 0.36.2 | `fonts/emoji-icon-font.ttf` | emoji-icon-font | John Slegers | MIT | https://github.com/jslegers/emoji-icon-font | egui fallback fonts (eframe feature default_fonts) |
|
|
297
|
-
| `hayro-cmap` 0.1.0 | `assets/cmaps.brotli` | Adobe CMap resources (predefined CJK CMaps) (non-visual data, AGENTS.md §1.1) | Adobe | BSD-3-Clause | https://github.com/adobe-type-tools/cmap-resources (via hayro-cmap) | Character-code mapping tables required to read CJK PDFs. Non-visual data, allowed by AGENTS.md §1.1 |
|
|
298
308
|
| `hayro-interpret` 0.7.0 | `src/font/generated/metrics.rs` | Standard-14 font metrics and encodings (as Rust tables) (non-visual data, AGENTS.md §1.1) | Adobe (Core 14 AFM metrics, PDF specification encodings); tables by The Hayro Authors | MIT OR Apache-2.0 | ISO 32000-2 Annex D; Adobe Core14 AFM files (via vendored hayro-interpret) | Glyph widths and encodings for non-embedded standard fonts. Non-visual data, allowed by AGENTS.md §1.1 |
|
|
299
309
|
|
|
300
310
|
## Downloaded at build time (22)
|
package/version.json
CHANGED
|
@@ -2893,7 +2893,7 @@ function __wbg_get_imports() {
|
|
|
2893
2893
|
return ret;
|
|
2894
2894
|
},
|
|
2895
2895
|
__wbindgen_generic_0000000000000004: function(arg0, arg1) {
|
|
2896
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx:
|
|
2896
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 7947, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2897
2897
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_e7a4a32c2194c314___convert__closures_____invoke___wasm_bindgen_e7a4a32c2194c314___sys__JsNullable_wgpu_5c9b80f14fc867ac___backend__webgpu__webgpu_sys__gen_GpuAdapter__GpuAdapter___core_608f92abc48d28da___result__Result_____wasm_bindgen_e7a4a32c2194c314___JsError___true_);
|
|
2898
2898
|
return ret;
|
|
2899
2899
|
},
|
|
@@ -2903,12 +2903,12 @@ function __wbg_get_imports() {
|
|
|
2903
2903
|
return ret;
|
|
2904
2904
|
},
|
|
2905
2905
|
__wbindgen_generic_0000000000000006: function(arg0, arg1) {
|
|
2906
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx:
|
|
2906
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 7947, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2907
2907
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_e7a4a32c2194c314___convert__closures_____invoke___wasm_bindgen_e7a4a32c2194c314___sys__JsNullable_wgpu_5c9b80f14fc867ac___backend__webgpu__webgpu_sys__gen_GpuAdapter__GpuAdapter___core_608f92abc48d28da___result__Result_____wasm_bindgen_e7a4a32c2194c314___JsError___true__6);
|
|
2908
2908
|
return ret;
|
|
2909
2909
|
},
|
|
2910
2910
|
__wbindgen_generic_0000000000000007: function(arg0, arg1) {
|
|
2911
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx:
|
|
2911
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 7947, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2912
2912
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_e7a4a32c2194c314___convert__closures_____invoke___wasm_bindgen_e7a4a32c2194c314___sys__JsNullable_wgpu_5c9b80f14fc867ac___backend__webgpu__webgpu_sys__gen_GpuAdapter__GpuAdapter___core_608f92abc48d28da___result__Result_____wasm_bindgen_e7a4a32c2194c314___JsError___true__7);
|
|
2913
2913
|
return ret;
|
|
2914
2914
|
},
|
|
@@ -2918,7 +2918,7 @@ function __wbg_get_imports() {
|
|
|
2918
2918
|
return ret;
|
|
2919
2919
|
},
|
|
2920
2920
|
__wbindgen_generic_0000000000000009: function(arg0, arg1) {
|
|
2921
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
2921
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 5380, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2922
2922
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_e7a4a32c2194c314___convert__closures_____invoke_______true_);
|
|
2923
2923
|
return ret;
|
|
2924
2924
|
},
|
package/viewer/index.html
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
<canvas id="fps-canvas"></canvas>
|
|
17
17
|
<script type="module">
|
|
18
18
|
// Generated by scripts/build.ps1: the hashed wasm-bindgen glue and module.
|
|
19
|
-
import init from "./fps-viewer-
|
|
20
|
-
init({ module_or_path: new URL("./fps-viewer-
|
|
19
|
+
import init from "./fps-viewer-85dcca9b96.js";
|
|
20
|
+
init({ module_or_path: new URL("./fps-viewer-ed545cbd01_bg.wasm", import.meta.url) }).catch((e) => console.error("Free PDF SDK: the viewer could not start", e));
|
|
21
21
|
</script>
|
|
22
22
|
</body>
|
|
23
23
|
</html>
|