@build-qube/papyra 0.1.0 → 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 +28 -1
- package/dist/document.d.ts +118 -4
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +208 -7
- package/dist/document.js.map +1 -1
- package/dist/encode.d.ts +2 -2
- package/dist/encode.d.ts.map +1 -1
- package/dist/encode.js +1 -1
- package/dist/encode.js.map +1 -1
- package/dist/encoded.d.ts +34 -5
- package/dist/encoded.d.ts.map +1 -1
- package/dist/encoded.js +28 -0
- package/dist/encoded.js.map +1 -1
- package/dist/errors.d.ts +45 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +69 -0
- package/dist/errors.js.map +1 -0
- package/dist/fingerprint.d.ts +18 -0
- package/dist/fingerprint.d.ts.map +1 -0
- package/dist/fingerprint.js +48 -0
- package/dist/fingerprint.js.map +1 -0
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/links.d.ts +53 -0
- package/dist/links.d.ts.map +1 -0
- package/dist/links.js +26 -0
- package/dist/links.js.map +1 -0
- package/dist/outline.d.ts +9 -1
- package/dist/outline.d.ts.map +1 -1
- package/dist/outline.js +9 -3
- package/dist/outline.js.map +1 -1
- package/dist/text.d.ts +2 -0
- package/dist/text.d.ts.map +1 -1
- package/dist/text.js +9 -0
- package/dist/text.js.map +1 -1
- package/dist/types.d.ts +50 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -42,6 +42,24 @@ export interface StreamOptions extends RenderOptions {
|
|
|
42
42
|
*/
|
|
43
43
|
order?: readonly number[];
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Options for {@link Document.renderSvg}. No `dpi` and no `fitWidth`: an SVG carries
|
|
47
|
+
* the page's own point dimensions and rasterises at whatever size it is drawn.
|
|
48
|
+
*/
|
|
49
|
+
export interface SvgOptions {
|
|
50
|
+
/** Scheduling order, exactly as in {@link RenderOptions.priority}. */
|
|
51
|
+
priority?: number;
|
|
52
|
+
/** Abort a request that has not started yet. */
|
|
53
|
+
signal?: AbortSignal;
|
|
54
|
+
/**
|
|
55
|
+
* Defaults to `'white'`, matching how pages rasterise.
|
|
56
|
+
*
|
|
57
|
+
* Choose `'transparent'` when the SVG is going to be placed onto something else —
|
|
58
|
+
* an opaque rectangle behind vector artwork is the one thing a consumer cannot
|
|
59
|
+
* undo.
|
|
60
|
+
*/
|
|
61
|
+
background?: 'white' | 'transparent';
|
|
62
|
+
}
|
|
45
63
|
/** A rendered page. `data` is tightly packed RGBA8, `height * stride` bytes. */
|
|
46
64
|
export interface RenderedPage {
|
|
47
65
|
/** Output width in pixels, after `dpi` or `fitWidth` was applied. */
|
|
@@ -78,6 +96,38 @@ export interface PageSize {
|
|
|
78
96
|
/** Height in points, with rotation and the crop box already applied. */
|
|
79
97
|
readonly height: number;
|
|
80
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* The document information dictionary — what the file says about itself.
|
|
101
|
+
*
|
|
102
|
+
* Every field is independently optional, and a field the document left blank reads as
|
|
103
|
+
* `null` rather than an empty string. None of it is verified: a producer writes what
|
|
104
|
+
* it likes, and `title` in particular is frequently a filename or absent entirely, so
|
|
105
|
+
* a viewer showing a document name should fall back to its own.
|
|
106
|
+
*/
|
|
107
|
+
export interface DocumentMetadata {
|
|
108
|
+
/** The document's own title, which is frequently a filename or absent. */
|
|
109
|
+
readonly title: string | null;
|
|
110
|
+
/** Who the document claims to be by. */
|
|
111
|
+
readonly author: string | null;
|
|
112
|
+
/** A one-line description. Rare outside of published documents. */
|
|
113
|
+
readonly subject: string | null;
|
|
114
|
+
/** Free text, and not reliably a delimited list — producers use commas or spaces. */
|
|
115
|
+
readonly keywords: string | null;
|
|
116
|
+
/** The application the document was authored in, e.g. `AutoCAD`. */
|
|
117
|
+
readonly creator: string | null;
|
|
118
|
+
/** The application that wrote the PDF, e.g. `Ghostscript`. */
|
|
119
|
+
readonly producer: string | null;
|
|
120
|
+
/**
|
|
121
|
+
* When the document was created, as an ISO 8601 string — `new Date(created)` parses
|
|
122
|
+
* it directly.
|
|
123
|
+
*
|
|
124
|
+
* A PDF date may be as short as a year, in which case the missing components read
|
|
125
|
+
* as January 1st. It is also self-reported, and clocks lie.
|
|
126
|
+
*/
|
|
127
|
+
readonly created: string | null;
|
|
128
|
+
/** When the document was last modified, ISO 8601. */
|
|
129
|
+
readonly modified: string | null;
|
|
130
|
+
}
|
|
81
131
|
/** Everything fixed for the lifetime of a {@link Document}: its queue and its caches. */
|
|
82
132
|
export interface OpenOptions {
|
|
83
133
|
/** Password for an encrypted document. */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,iFAAiF;AACjF,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,eAAe,GAAG,IAAI,CAAC;AAE1E,4DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC5B;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,mEAAmE;IACnE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,6EAA6E;AAC7E,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B;AAED,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,qEAAqE;IACrE,QAAQ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;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@build-qube/papyra",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Fast PDF rendering for Node and the browser, powered by Rust",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"test:integration": "bun test test/integration"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@build-qube/papyra-native": "0.
|
|
43
|
+
"@build-qube/papyra-native": "0.2.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"typescript": "^7.0.2"
|