bookcover-web 0.23.0 → 0.24.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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -105,6 +105,7 @@ interface GenerateOptions {
|
|
|
105
105
|
format?: 'pdf'|'svg'|'png' // default: 'pdf'
|
|
106
106
|
ppi?: number // PNG resolution, default: 144
|
|
107
107
|
split?: boolean // include split panels in result
|
|
108
|
+
pdf_pages?: boolean // PDF: front and back pages (no spine), bleed all round
|
|
108
109
|
custom_fonts?: Uint8Array[] // raw TTF bytes for custom fonts
|
|
109
110
|
}
|
|
110
111
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -453,6 +453,12 @@ export class CoverGenerator {
|
|
|
453
453
|
result.split = await split_png(data, dims, ppi, canvas_crop);
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
+
// Front and back pages, cut from the wraparound once any split above has used it. Loaded on
|
|
457
|
+
// demand, as it brings pdf-lib with it
|
|
458
|
+
if (options.pdf_pages && format === 'pdf') {
|
|
459
|
+
const { split_pdf_pages } = await import('bookcover-core/pdf-pages');
|
|
460
|
+
result.data = await split_pdf_pages(data, dims);
|
|
461
|
+
}
|
|
456
462
|
return result;
|
|
457
463
|
}
|
|
458
464
|
/** Revoke blob URLs and drop cached font bytes to free memory */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bookcover-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"license": "MIT-0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@myriaddreamin/typst-ts-renderer": "0.7.0",
|
|
41
41
|
"@myriaddreamin/typst-ts-web-compiler": "0.7.0",
|
|
42
42
|
"@myriaddreamin/typst.ts": "0.7.0",
|
|
43
|
-
"bookcover-core": "^0.
|
|
43
|
+
"bookcover-core": "^0.24.0",
|
|
44
44
|
"typst-fonts": "^0.1.4"
|
|
45
45
|
},
|
|
46
46
|
"sideEffects": false
|