@zilijonas/foliark 0.1.6 → 0.2.0
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/README.md +4 -2
- package/SUPPORT_MATRIX.md +1 -1
- package/dist/generated/ExportPolicy.d.ts +2 -0
- package/dist/generated/KeptReport.d.ts +5 -0
- package/dist/generated/LinkPolicy.d.ts +5 -0
- package/dist/generated/LinkPolicy.js +2 -0
- package/package.json +1 -1
- package/wasm/foliark_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<p align="center"><b>A PDF engine in Rust and WebAssembly for the browser. Extract, search, render, edit, redact and sanitize PDFs on the user's device. The document never leaves it.</b></p>
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm install @zilijonas/foliark@0.
|
|
8
|
+
npm install @zilijonas/foliark@0.2.0 --save-exact
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
ESM only, no runtime dependencies, typed. Runs in a worker, fetches only its own `.wasm` and worker script, and refuses what it cannot do safely with a typed `FoliarkError` instead of degrading quietly.
|
|
@@ -93,6 +93,8 @@ Image-only export burns the redactions into pixels:
|
|
|
93
93
|
const flat = await doc.export(await doc.prepareExport({ mode: "raster", policy: { raster: { acknowledgeLosses: true, scale: 2 } } }));
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
Native export removes hyperlinks by default; `policy: { links: "keep" }` keeps `http`, `https`, `mailto` and in-document links that no redaction touches or spells (`plan.report.kept.links`; the rest are `LINKS_REMOVED`).
|
|
97
|
+
|
|
96
98
|
Already running your own dedicated worker with its own recovery? Use the in-worker entry. Same API and errors, no second worker, and your worker supervises hangs and must be replaced after `onReset`:
|
|
97
99
|
|
|
98
100
|
```ts
|
|
@@ -126,6 +128,6 @@ Chromium on desktop (macOS arm64) is supported and has budgets. WebKit is suppor
|
|
|
126
128
|
|
|
127
129
|
[AGPL-3.0-only](https://github.com/zilijonas/foliark/blob/main/LICENSE), the same licence family as the AGPL option PyMuPDF is offered under. If the AGPL does not fit your use, separate commercial licensing is available: see `COMMERCIAL-LICENSING.md` in the package. This is not legal advice. Details are in `LICENSING.md`.
|
|
128
130
|
|
|
129
|
-
Foliark is free software, so the complete corresponding source of version 0.
|
|
131
|
+
Foliark is free software, so the complete corresponding source of version 0.2.0 (Rust engine, vendored hayro fork and patches, build scripts) is tag `v0.2.0` of https://github.com/zilijonas/foliark. Build steps are in `docs/development.md` there (`scripts/build-wasm.sh`, `pnpm build:sdk`, `tests/package-consumers/pack.sh`). The package contains `dist/`, `wasm/` (5.8 MB raw, 2.2 MB gzip), `cmaps/`, `LICENSE`, `LICENSING.md`, `COMMERCIAL-LICENSING.md`, `LICENSE_FOXIT`, `NOTICE`, `THIRD_PARTY_NOTICES.md` and `SUPPORT_MATRIX.md`.
|
|
130
132
|
|
|
131
133
|
PyMuPDF and MuPDF are products of Artifex Software, Inc. Foliark is independent of them and not affiliated with Artifex.
|
package/SUPPORT_MATRIX.md
CHANGED
|
@@ -69,7 +69,7 @@ Each class is removed and reported, or refused. Evidence is `strict-native.md` (
|
|
|
69
69
|
| Info and XMP metadata, PieceInfo, private keys | supported (removed) | `METADATA_REMOVED` |
|
|
70
70
|
| Embedded files, /AF | supported (removed) | `ATTACHMENTS_REMOVED` |
|
|
71
71
|
| JavaScript, OpenAction, AA, all actions | supported (removed) | `SCRIPTS_REMOVED` |
|
|
72
|
-
| Annotations | supported (flatten with appearance, or remove) | `ANNOTATIONS_FLATTENED`, `ANNOTATIONS_REMOVED`, `LINKS_REMOVED` |
|
|
72
|
+
| Annotations | supported (flatten with appearance, or remove); links removed, or with `links: 'keep'` (native) written back when safe (ADR 0014) | `ANNOTATIONS_FLATTENED`, `ANNOTATIONS_REMOVED`, `LINKS_REMOVED`, `report.kept.links` |
|
|
73
73
|
| AcroForm and widgets | supported (appearances flattened, values removed); a value without a usable appearance is refused | `FORMS_FLATTENED`; `FORM_APPEARANCE_MISSING {fields}`, `XFA_UNSUPPORTED` (engine tests `sanitize_interactive.rs`; no manifest fixture, no independent oracle) |
|
|
74
74
|
| Optional content | supported (default configuration flattened, `/VE` And/Not evaluated, hidden layers removed) | `LAYERS_FLATTENED`; `OPTIONAL_CONTENT_UNSUPPORTED` when visibility cannot be evaluated (no manifest fixture) |
|
|
75
75
|
| Thumbnails, outlines, page labels, structure tree, ActualText/Alt, output intents, viewer preferences | supported (removed) | `thumbnails`, `OUTLINES_REMOVED`, `PAGE_LABELS_REMOVED`, `ACCESSIBILITY_REMOVED`, `PDFA_CLAIM_REMOVED` |
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AnnotationPolicy } from "./AnnotationPolicy";
|
|
2
2
|
import type { InvisibleTextPolicy } from "./InvisibleTextPolicy";
|
|
3
|
+
import type { LinkPolicy } from "./LinkPolicy";
|
|
3
4
|
import type { RasterPolicy } from "./RasterPolicy";
|
|
4
5
|
import type { SignedInputPolicy } from "./SignedInputPolicy";
|
|
5
6
|
/**
|
|
@@ -7,6 +8,7 @@ import type { SignedInputPolicy } from "./SignedInputPolicy";
|
|
|
7
8
|
*/
|
|
8
9
|
export type ExportPolicy = {
|
|
9
10
|
annotations: AnnotationPolicy;
|
|
11
|
+
links: LinkPolicy;
|
|
10
12
|
signedInput: SignedInputPolicy;
|
|
11
13
|
invisibleText: InvisibleTextPolicy;
|
|
12
14
|
raster: RasterPolicy;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zilijonas/foliark",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Rust/WebAssembly PDF SDK for the browser: extract text, render, edit, redact and sanitize PDFs offline. A PyMuPDF alternative. AGPL-3.0.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
Binary file
|