gutterpress 0.11.19 → 0.11.20-alpha.1
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/dist/api/index.js +2 -2
- package/dist/{build-czbaj4qf.js → build-cmf4nbpm.js} +4 -4
- package/dist/{cli-cgbzdrwz.js → cli-7shp2kmj.js} +1 -1
- package/dist/{cli-dzw28t3s.js → cli-mmm22cza.js} +2 -1
- package/dist/{cli-xx94a1k6.js → cli-rtpm04dv.js} +4 -4
- package/dist/{cli-aw614ztv.js → cli-x1nfhaf1.js} +25 -14
- package/dist/cli.js +12 -12
- package/dist/{doctor-6e9perj7.js → doctor-0d6esj02.js} +2 -2
- package/dist/{engine-fe0n7v9p.js → engine-1v8kmv3a.js} +1 -1
- package/dist/{engine-zehw6tkv.js → engine-adxptzf0.js} +2 -2
- package/dist/{ext-kavfk1zn.js → ext-65nfh7st.js} +4 -4
- package/dist/{gutterpress-viewer-k4mpqjh0.js → gutterpress-viewer-0r4rt4de.js} +222 -233
- package/dist/{index-g7vszjqf.js → index-1y885h1j.js} +25 -13
- package/dist/{index-b866g2ph.js → index-cngw658w.js} +1 -1
- package/dist/{index-jt552wtf.js → index-pnvzgftg.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/lib/ghostscript.d.ts +7 -0
- package/dist/{manifest.schema-5pzhscqh.json → manifest.schema-nrykd2c6.json} +14 -1
- package/dist/{new-ckpas1ya.js → new-y4a2xz3g.js} +4 -4
- package/dist/{preflight-yh57q9nn.js → preflight-kt7wfgbd.js} +4 -4
- package/dist/preview/file-watcher.d.ts +9 -1
- package/dist/{preview-a4x2ezjp.js → preview-5ze728kp.js} +4 -4
- package/dist/{preview-interface-2n1d9pbf.js → preview-interface-k2mj5kvq.js} +12 -12
- package/dist/{preview-shell-hyp7g158.js → preview-shell-7jfe6vsc.js} +3 -3
- package/dist/{publish-sfn5hmnx.js → publish-5tpcyysh.js} +4 -4
- package/dist/schema/manifest.types.d.ts +17 -3
- package/dist/{validate-281rsdsv.js → validate-p0hkqkfe.js} +4 -4
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
getAssetsDir,
|
|
10
10
|
lastPageMode,
|
|
11
11
|
parseSize
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-pnvzgftg.js";
|
|
13
13
|
import {
|
|
14
14
|
INSTALL_HINTS,
|
|
15
15
|
enhancedPath,
|
|
@@ -151,13 +151,15 @@ var DTRPG_PRESET = {
|
|
|
151
151
|
flavor: "x1a",
|
|
152
152
|
icc: "profiles/CGATS21_CRPC1.icc",
|
|
153
153
|
stripAnnotations: true,
|
|
154
|
-
blackText: "k-only"
|
|
154
|
+
blackText: "k-only",
|
|
155
|
+
rasterDpi: undefined
|
|
155
156
|
},
|
|
156
157
|
page: {
|
|
157
158
|
width: 621,
|
|
158
159
|
height: 810,
|
|
159
160
|
tolerance: 0.5,
|
|
160
|
-
bleed: 9
|
|
161
|
+
bleed: 9,
|
|
162
|
+
safe: 18
|
|
161
163
|
},
|
|
162
164
|
ink: {
|
|
163
165
|
maxTac: 240,
|
|
@@ -228,13 +230,15 @@ var BOOK_PRESET = {
|
|
|
228
230
|
flavor: "x1a",
|
|
229
231
|
icc: "profiles/CGATS21_CRPC1.icc",
|
|
230
232
|
stripAnnotations: true,
|
|
231
|
-
blackText: "icc"
|
|
233
|
+
blackText: "icc",
|
|
234
|
+
rasterDpi: undefined
|
|
232
235
|
},
|
|
233
236
|
page: {
|
|
234
237
|
width: 432,
|
|
235
238
|
height: 648,
|
|
236
239
|
tolerance: 0.5,
|
|
237
|
-
bleed: undefined
|
|
240
|
+
bleed: undefined,
|
|
241
|
+
safe: 18
|
|
238
242
|
},
|
|
239
243
|
ink: {
|
|
240
244
|
maxTac: 400,
|
|
@@ -588,7 +592,8 @@ function resolveCustomPage(c, m) {
|
|
|
588
592
|
width,
|
|
589
593
|
height,
|
|
590
594
|
tolerance: c.page?.tolerance ?? m.page?.tolerance ?? 0.5,
|
|
591
|
-
bleed: c.page?.bleed ?? m.page?.bleed
|
|
595
|
+
bleed: c.page?.bleed ?? m.page?.bleed,
|
|
596
|
+
safe: c.page?.safe ?? m.page?.safe
|
|
592
597
|
};
|
|
593
598
|
}
|
|
594
599
|
function resolveWithPreset(cliOverrides, manifest, preset) {
|
|
@@ -621,6 +626,10 @@ function resolveWithPreset(cliOverrides, manifest, preset) {
|
|
|
621
626
|
if (lastPage !== undefined && lastPage !== "blank" && lastPage !== "short-by-one") {
|
|
622
627
|
throw new UsageError(`Manifest field \`print.lastPage\` must be "blank" or "short-by-one", got ${JSON.stringify(lastPage)}.`);
|
|
623
628
|
}
|
|
629
|
+
const rasterDpi = c.pdfx?.rasterDpi ?? m.pdfx?.rasterDpi;
|
|
630
|
+
if (rasterDpi !== undefined && !(Number.isInteger(rasterDpi) && rasterDpi >= 72 && rasterDpi <= 1200)) {
|
|
631
|
+
throw new UsageError(`Manifest field \`pdfx.rasterDpi\` must be a whole number from 72 to 1200, got ${JSON.stringify(rasterDpi)}.`);
|
|
632
|
+
}
|
|
624
633
|
const rawExtensions = c.extensions ?? m.extensions ?? [];
|
|
625
634
|
if (!Array.isArray(rawExtensions)) {
|
|
626
635
|
throw new UsageError("Manifest field `extensions` must be a list of specifiers.");
|
|
@@ -5935,6 +5944,7 @@ async function convertToPdfxCmyk(inputPdf, outPdf, config) {
|
|
|
5935
5944
|
"-dDownsampleColorImages=false",
|
|
5936
5945
|
"-dDownsampleGrayImages=false",
|
|
5937
5946
|
"-dDownsampleMonoImages=false",
|
|
5947
|
+
...config.rasterDpi ? [`-r${config.rasterDpi}`] : [],
|
|
5938
5948
|
"-sProcessColorModel=DeviceCMYK",
|
|
5939
5949
|
"-sColorConversionStrategy=CMYK",
|
|
5940
5950
|
"-dOverrideICC=true",
|
|
@@ -5984,7 +5994,7 @@ import git from "isomorphic-git";
|
|
|
5984
5994
|
// package.json
|
|
5985
5995
|
var package_default = {
|
|
5986
5996
|
name: "gutterpress",
|
|
5987
|
-
version: "0.11.
|
|
5997
|
+
version: "0.11.20-alpha.1",
|
|
5988
5998
|
description: "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
|
|
5989
5999
|
author: "itlackey",
|
|
5990
6000
|
license: "MPL-2.0",
|
|
@@ -10903,7 +10913,7 @@ class PdfOutput {
|
|
|
10903
10913
|
const rawPdf = pdfxMode ? path13.join(stage, "raw.pdf") : path13.resolve(pdfFile);
|
|
10904
10914
|
await fsp2.mkdir(path13.dirname(path13.resolve(pdfFile)), { recursive: true });
|
|
10905
10915
|
log.info("Rendering HTML to PDF via the Gutterpress engine (native Chromium pagination)");
|
|
10906
|
-
const { buildNativePdf } = await import("./engine-
|
|
10916
|
+
const { buildNativePdf } = await import("./engine-adxptzf0.js");
|
|
10907
10917
|
const engineDiagnostics = await buildNativePdf(htmlFile, rawPdf, {
|
|
10908
10918
|
title: config.title,
|
|
10909
10919
|
author: config.authors.length > 0 ? config.authors.join(", ") : undefined,
|
|
@@ -10926,7 +10936,7 @@ class PdfOutput {
|
|
|
10926
10936
|
const icc = opts.iccPath ?? config.pdfx.icc;
|
|
10927
10937
|
effectiveIccPath = await resolveIccProfile(icc, manifestDir, opts.iccPath);
|
|
10928
10938
|
if (await hasLiveTransparency(await fsp2.readFile(rawPdf))) {
|
|
10929
|
-
log.warn("This book uses transparency — an image with an alpha channel, or a CSS " + `rule like \`opacity\` or \`mix-blend-mode\`. PDF/${pdfxMode === "x1a" ? "X-1a" : "X-3"} has no way to represent that (both are based on PDF 1.3, which predates PDF transparency), so Ghostscript will flatten every page that uses it into a single raster ` + "image — that page loses its embedded fonts and searchable text in the " + "PDF/X output. To keep vector text, remove the `opacity`/blend rule and flatten any alpha-channel image against its intended background before including it (export it with no alpha channel), or build --format pdf instead of pdfx if this book doesn't need print-ready CMYK.");
|
|
10939
|
+
log.warn("This book uses transparency — an image with an alpha channel, or a CSS " + `rule like \`opacity\` or \`mix-blend-mode\`. PDF/${pdfxMode === "x1a" ? "X-1a" : "X-3"} has no way to represent that (both are based on PDF 1.3, which predates PDF transparency), so Ghostscript will flatten every page that uses it into a single raster ` + "image — that page loses its embedded fonts and searchable text in the " + "PDF/X output. To keep vector text, remove the `opacity`/blend rule and flatten any alpha-channel image against its intended background before including it (export it with no alpha channel), or build --format pdf instead of pdfx if this book doesn't need print-ready CMYK. `pdfx.rasterDpi` sets the resolution of those page images (default 720).");
|
|
10930
10940
|
}
|
|
10931
10941
|
const blankGradientPages = await findPostScriptShadingPages(await fsp2.readFile(rawPdf));
|
|
10932
10942
|
if (blankGradientPages.length > 0) {
|
|
@@ -10948,7 +10958,8 @@ class PdfOutput {
|
|
|
10948
10958
|
pdfx: pdfxMode,
|
|
10949
10959
|
title: config.title,
|
|
10950
10960
|
maxTac: config.ink.maxTac,
|
|
10951
|
-
stagingDir: stage
|
|
10961
|
+
stagingDir: stage,
|
|
10962
|
+
rasterDpi: config.pdfx.rasterDpi
|
|
10952
10963
|
});
|
|
10953
10964
|
}
|
|
10954
10965
|
if (gates.postValidate) {
|
|
@@ -11130,8 +11141,9 @@ async function renderPreviewBook(inputPath, config, opts) {
|
|
|
11130
11141
|
}
|
|
11131
11142
|
});
|
|
11132
11143
|
}
|
|
11133
|
-
function injectPreviewScripts(html,
|
|
11134
|
-
const
|
|
11144
|
+
function injectPreviewScripts(html, page) {
|
|
11145
|
+
const area = page ? JSON.stringify({ width: page.width, height: page.height, bleed: page.bleed ?? 0, safe: page.safe ?? 0 }) : "";
|
|
11146
|
+
const meta = area ? ` <meta name="gp-print-area" content='${area}'>
|
|
11135
11147
|
` : "";
|
|
11136
11148
|
const scripts = meta + ` <script src="/engine/gutterpress-viewer.js"></script>
|
|
11137
11149
|
` + `<script src="/preview/scripts/preview-interface.js"></script>
|
|
@@ -11167,7 +11179,7 @@ async function generateAndWriteHtml(inputPath, tempDir, config, cssAssets, image
|
|
|
11167
11179
|
for (const ref of nextImageRefs)
|
|
11168
11180
|
imageRefs.add(ref);
|
|
11169
11181
|
}
|
|
11170
|
-
await fsp3.writeFile(path15.join(tempDir, BOOK_HTML_FILENAME), injectPreviewScripts(html, config.page
|
|
11182
|
+
await fsp3.writeFile(path15.join(tempDir, BOOK_HTML_FILENAME), injectPreviewScripts(html, config.page), "utf-8");
|
|
11171
11183
|
}
|
|
11172
11184
|
function isDotPathUnderRoot(candidatePath, root) {
|
|
11173
11185
|
const normalizedRoot = root.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
@@ -148,22 +148,22 @@ import { fileURLToPath } from "node:url";
|
|
|
148
148
|
var favicon_default = "./favicon-272ga6y0.ico";
|
|
149
149
|
|
|
150
150
|
// src/assets/manifest.schema.json
|
|
151
|
-
var manifest_schema_default = "./manifest.schema-
|
|
151
|
+
var manifest_schema_default = "./manifest.schema-nrykd2c6.json";
|
|
152
152
|
|
|
153
153
|
// src/assets/preview/scripts/preview-interface.js
|
|
154
|
-
var preview_interface_default = "./preview-interface-
|
|
154
|
+
var preview_interface_default = "./preview-interface-k2mj5kvq.js";
|
|
155
155
|
|
|
156
156
|
// src/assets/preview/scripts/preview-bridge.js
|
|
157
157
|
var preview_bridge_default = "./preview-bridge-evecsh4w.js";
|
|
158
158
|
|
|
159
159
|
// src/assets/preview/scripts/preview-shell.js
|
|
160
|
-
var preview_shell_default = "./preview-shell-
|
|
160
|
+
var preview_shell_default = "./preview-shell-7jfe6vsc.js";
|
|
161
161
|
|
|
162
162
|
// profiles/CGATS21_CRPC1.icc
|
|
163
163
|
var CGATS21_CRPC1_default = "./CGATS21_CRPC1-g0e3k7kr.icc";
|
|
164
164
|
|
|
165
165
|
// src/assets/engine/gutterpress-viewer.js
|
|
166
|
-
var gutterpress_viewer_default = "./gutterpress-viewer-
|
|
166
|
+
var gutterpress_viewer_default = "./gutterpress-viewer-0r4rt4de.js";
|
|
167
167
|
|
|
168
168
|
// src/assets/engine/gutterpress-agent.js
|
|
169
169
|
var gutterpress_agent_default = "./gutterpress-agent-cazqstr1.js";
|
package/dist/index.js
CHANGED
|
@@ -154,14 +154,14 @@ import {
|
|
|
154
154
|
testRemoteAccess,
|
|
155
155
|
updateExtensions,
|
|
156
156
|
validateProjectExtensions
|
|
157
|
-
} from "./index-
|
|
157
|
+
} from "./index-1y885h1j.js";
|
|
158
158
|
import"./index-ht1bcqdd.js";
|
|
159
159
|
import {
|
|
160
160
|
BUILD_DIAGNOSTIC_CODES
|
|
161
|
-
} from "./index-
|
|
161
|
+
} from "./index-cngw658w.js";
|
|
162
162
|
import {
|
|
163
163
|
BuildError
|
|
164
|
-
} from "./index-
|
|
164
|
+
} from "./index-pnvzgftg.js";
|
|
165
165
|
import {
|
|
166
166
|
DEFAULT_PRINT_OPTS,
|
|
167
167
|
assertMilestone,
|
|
@@ -100,5 +100,12 @@ export declare function convertToPdfxCmyk(inputPdf: string, outPdf: string, conf
|
|
|
100
100
|
title?: string;
|
|
101
101
|
maxTac?: number;
|
|
102
102
|
stagingDir: string;
|
|
103
|
+
/**
|
|
104
|
+
* Resolution of the picture Ghostscript makes of a page it flattens
|
|
105
|
+
* (`pdfx.rasterDpi`). Unset keeps Ghostscript's own default (720 DPI).
|
|
106
|
+
* pdfwrite uses it only for rendering it must do, such as transparency
|
|
107
|
+
* flattening: vector content is unaffected.
|
|
108
|
+
*/
|
|
109
|
+
rasterDpi?: number;
|
|
103
110
|
}): Promise<void>;
|
|
104
111
|
export {};
|
|
@@ -154,6 +154,13 @@
|
|
|
154
154
|
"description": "How near-black text is separated. `icc` converts it through the ICC profile (rich, four-colour black). `k-only` prints it on the black plate alone (100% K), which print vendors such as DriveThruRPG require for small text. Non-text black (rules, panels) is unaffected. Preset defaults: dtrpg `k-only`, book `icc`.",
|
|
155
155
|
"enum": ["icc", "k-only"],
|
|
156
156
|
"default": "icc"
|
|
157
|
+
},
|
|
158
|
+
"rasterDpi": {
|
|
159
|
+
"type": "integer",
|
|
160
|
+
"description": "Resolution (DPI) of the picture Ghostscript makes of a page it flattens in a PDF/X build because the page uses transparency (PDF/X-1a and X-3 cannot hold it). Lower is smaller and softer; vector content on other pages and the book's own images are not resampled. Unset: Ghostscript's default, 720.",
|
|
161
|
+
"minimum": 72,
|
|
162
|
+
"maximum": 1200,
|
|
163
|
+
"examples": [300]
|
|
157
164
|
}
|
|
158
165
|
}
|
|
159
166
|
},
|
|
@@ -203,9 +210,15 @@
|
|
|
203
210
|
},
|
|
204
211
|
"bleed": {
|
|
205
212
|
"type": "number",
|
|
206
|
-
"description": "A bleed, in points, that the page width x height ALREADY CONTAINS on the top, bottom and OUTER edges (none on the binding edge) — how DriveThruRPG's interior file is cut (8.625 x 11.25in for an 8.5 x 11in book). Preview overlay only: it tells the
|
|
213
|
+
"description": "A bleed, in points, that the page width x height ALREADY CONTAINS on the top, bottom and OUTER edges (none on the binding edge) — how DriveThruRPG's interior file is cut (8.625 x 11.25in for an 8.5 x 11in book). Preview overlay only: it tells the safe area & bleed overlay where the trim is and changes nothing in the PDF. Preset default: dtrpg 9 (0.125in); book and custom none.",
|
|
207
214
|
"minimum": 0,
|
|
208
215
|
"examples": [9]
|
|
216
|
+
},
|
|
217
|
+
"safe": {
|
|
218
|
+
"type": "number",
|
|
219
|
+
"description": "The safe area's inset, in points, from the trim on every edge: the preview's overlay outlines it and flags content outside it. Preview overlay only: it changes nothing in the PDF, and no book CSS moves it. Preset default: dtrpg and book 18 (0.25in); custom none.",
|
|
220
|
+
"minimum": 0,
|
|
221
|
+
"examples": [18, 36]
|
|
209
222
|
}
|
|
210
223
|
}
|
|
211
224
|
},
|
|
@@ -7,17 +7,17 @@ import {
|
|
|
7
7
|
TARGET_IDS,
|
|
8
8
|
scaffoldExtension,
|
|
9
9
|
scaffoldProject
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-x1nfhaf1.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveGhostscript
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-mmm22cza.js";
|
|
14
14
|
import {
|
|
15
15
|
UsageError,
|
|
16
16
|
rejectExtraPositionals,
|
|
17
17
|
rejectUnknownFlags
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-7shp2kmj.js";
|
|
19
19
|
import"./cli-ht1bcqdd.js";
|
|
20
|
-
import"./cli-
|
|
20
|
+
import"./cli-rtpm04dv.js";
|
|
21
21
|
import {
|
|
22
22
|
EXIT_CODES
|
|
23
23
|
} from "./cli-46ycxe6r.js";
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
executeValidation,
|
|
3
3
|
publishTargetFor,
|
|
4
4
|
reportMissingTools
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-x1nfhaf1.js";
|
|
6
6
|
import {
|
|
7
7
|
log
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-mmm22cza.js";
|
|
9
9
|
import {
|
|
10
10
|
UsageError,
|
|
11
11
|
rejectExtraPositionals,
|
|
12
12
|
rejectUnknownFlags
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-7shp2kmj.js";
|
|
14
14
|
import"./cli-ht1bcqdd.js";
|
|
15
|
-
import"./cli-
|
|
15
|
+
import"./cli-rtpm04dv.js";
|
|
16
16
|
import {
|
|
17
17
|
BuildError,
|
|
18
18
|
EXIT_CODES
|
|
@@ -22,7 +22,12 @@ import type { PrintPadding } from '../engine/shared/synthesis.ts';
|
|
|
22
22
|
* no per-source wrappers or forced breaks are added, so preview pagination
|
|
23
23
|
* never diverges from the PDF where a source file begins mid-page.
|
|
24
24
|
*/
|
|
25
|
-
export declare function injectPreviewScripts(html: string,
|
|
25
|
+
export declare function injectPreviewScripts(html: string, page?: {
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
bleed?: number;
|
|
29
|
+
safe?: number;
|
|
30
|
+
}): string;
|
|
26
31
|
/**
|
|
27
32
|
* Generate HTML from markdown and write book.html to the temp directory.
|
|
28
33
|
* The desktop's iframe loads `book.html` via a relative URL — same name in
|
|
@@ -46,7 +51,10 @@ export declare function generateAndWriteHtml(inputPath: string, tempDir: string,
|
|
|
46
51
|
extensions?: ResolvedExtensionConfig[];
|
|
47
52
|
print?: PrintPadding;
|
|
48
53
|
page?: {
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
49
56
|
bleed?: number;
|
|
57
|
+
safe?: number;
|
|
50
58
|
};
|
|
51
59
|
}, cssAssets: Map<string, string>, imageRefs?: Set<string>): Promise<void>;
|
|
52
60
|
/**
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
runBuild,
|
|
7
7
|
splitOutPath,
|
|
8
8
|
startPreviewServer
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-x1nfhaf1.js";
|
|
10
10
|
import {
|
|
11
11
|
log
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-mmm22cza.js";
|
|
13
13
|
import {
|
|
14
14
|
UsageError,
|
|
15
15
|
parseFormat,
|
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
rejectExtraPositionals,
|
|
18
18
|
rejectUnknownFlags,
|
|
19
19
|
resolvePort
|
|
20
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-7shp2kmj.js";
|
|
21
21
|
import"./cli-ht1bcqdd.js";
|
|
22
|
-
import"./cli-
|
|
22
|
+
import"./cli-rtpm04dv.js";
|
|
23
23
|
import {
|
|
24
24
|
BuildError
|
|
25
25
|
} from "./cli-46ycxe6r.js";
|
|
@@ -1105,13 +1105,13 @@
|
|
|
1105
1105
|
// second argument — the look, below — is part of v9, not a bump.)
|
|
1106
1106
|
getProtocolVersion: function () { return 9; },
|
|
1107
1107
|
|
|
1108
|
-
//
|
|
1109
|
-
// and no attribute to its elements, so pagination is identical on or
|
|
1110
|
-
// Returns the summary {on, issues, intended, bleedPt}, or null
|
|
1111
|
-
// viewer predates it. `style` ({color: '#rrggbb', strength:
|
|
1112
|
-
// 'normal' | 'strong'}) is optional: it only sets the
|
|
1113
|
-
//
|
|
1114
|
-
//
|
|
1108
|
+
// Safe area & bleed overlay. Viewer chrome only — it adds no box to the
|
|
1109
|
+
// book and no attribute to its elements, so pagination is identical on or
|
|
1110
|
+
// off. Returns the summary {on, issues, intended, bleedPt, safePt}, or null
|
|
1111
|
+
// when the viewer predates it. `style` ({color: '#rrggbb', strength:
|
|
1112
|
+
// 'subtle' | 'normal' | 'strong'}) is optional: it only sets the overlay's
|
|
1113
|
+
// own tokens, and a call that carries it while the overlay is already on
|
|
1114
|
+
// restyles without repainting.
|
|
1115
1115
|
setMarginOverlay: function (on, style) {
|
|
1116
1116
|
var d = window.Gutterpress && window.Gutterpress.decoration;
|
|
1117
1117
|
return d && typeof d.setOverlay === 'function' ? d.setOverlay(!!on, style) : null;
|
|
@@ -1629,7 +1629,7 @@
|
|
|
1629
1629
|
// completes (engine/viewer/index.ts's mount()).
|
|
1630
1630
|
window.addEventListener('gp:layout', onRenderingComplete);
|
|
1631
1631
|
|
|
1632
|
-
//
|
|
1632
|
+
// Safe area & bleed overlay: relay the viewer's result as 'overlayChanged' (the
|
|
1633
1633
|
// bridge posts it to a host toolbar) and, where no host toolbar exists, give
|
|
1634
1634
|
// the standalone CLI preview its own switch: Alt+M, plus a small status pill.
|
|
1635
1635
|
// "Standalone" = the shell is top level (the CLI); under the desktop app the
|
|
@@ -1652,11 +1652,11 @@
|
|
|
1652
1652
|
'padding:4px 10px;border-radius:999px;box-shadow:0 1px 6px rgba(0,0,0,.4)';
|
|
1653
1653
|
document.documentElement.appendChild(badge);
|
|
1654
1654
|
}
|
|
1655
|
-
var parts = ['
|
|
1656
|
-
parts.push(summary.issues ? summary.issues + '
|
|
1655
|
+
var parts = ['Safe area & bleed'];
|
|
1656
|
+
parts.push(summary.issues ? summary.issues + ' outside the safe area' : 'everything inside the safe area');
|
|
1657
1657
|
if (summary.intended) parts.push(summary.intended + ' placed on purpose');
|
|
1658
|
-
if (summary.
|
|
1659
|
-
if (!summary.bleedPt) parts.push('no bleed set
|
|
1658
|
+
if (!summary.safePt) parts.push('no safe area set (page.safe in manifest.yaml)');
|
|
1659
|
+
if (!summary.bleedPt) parts.push('no bleed set (page.bleed in manifest.yaml)');
|
|
1660
1660
|
badge.textContent = parts.join(' \u00b7 ') + ' (Alt+M hides)';
|
|
1661
1661
|
}
|
|
1662
1662
|
|
|
@@ -106,12 +106,12 @@
|
|
|
106
106
|
else if (sourceBody.classList.contains('view-spread')) api.setViewMode('spread', true);
|
|
107
107
|
else if (sourceBody.classList.contains('view-two-column')) api.setViewMode('two-column', true);
|
|
108
108
|
if (sourceBody.classList.contains('debug')) api.toggleDebugMode();
|
|
109
|
-
// The
|
|
110
|
-
// hot reload must not drop it.
|
|
109
|
+
// The safe area & bleed overlay is a review aid the author switched on:
|
|
110
|
+
// a hot reload must not drop it.
|
|
111
111
|
// Its look (colour, strength) travels with it.
|
|
112
112
|
if (sourceBody.dataset.overlay === 'on' && api.setMarginOverlay) {
|
|
113
113
|
api.setMarginOverlay(true, {
|
|
114
|
-
color: sourceBody.
|
|
114
|
+
color: sourceBody.dataset.overlayColor,
|
|
115
115
|
strength: sourceBody.dataset.overlayStrength
|
|
116
116
|
});
|
|
117
117
|
}
|
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
publishProviderFor,
|
|
12
12
|
resolvePublishFormat,
|
|
13
13
|
runPublish
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-x1nfhaf1.js";
|
|
15
15
|
import {
|
|
16
16
|
FileTokenStore,
|
|
17
17
|
log
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-mmm22cza.js";
|
|
19
19
|
import {
|
|
20
20
|
UsageError,
|
|
21
21
|
rejectExtraPositionals,
|
|
22
22
|
rejectUnknownFlags
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-7shp2kmj.js";
|
|
24
24
|
import"./cli-ht1bcqdd.js";
|
|
25
|
-
import"./cli-
|
|
25
|
+
import"./cli-rtpm04dv.js";
|
|
26
26
|
import {
|
|
27
27
|
EXIT_CODES
|
|
28
28
|
} from "./cli-46ycxe6r.js";
|
|
@@ -118,6 +118,11 @@ export interface GutterpressManifest {
|
|
|
118
118
|
stripAnnotations?: boolean;
|
|
119
119
|
/** `k-only` prints near-black text on the black plate alone (#331). */
|
|
120
120
|
blackText?: "icc" | "k-only";
|
|
121
|
+
/**
|
|
122
|
+
* Resolution (DPI) of the picture Ghostscript makes of a page it flattens
|
|
123
|
+
* because the page uses transparency. Unset: Ghostscript's default (720).
|
|
124
|
+
*/
|
|
125
|
+
rasterDpi?: number;
|
|
121
126
|
};
|
|
122
127
|
/**
|
|
123
128
|
* Native-engine print-production options with no other manifest home
|
|
@@ -150,11 +155,17 @@ export interface GutterpressManifest {
|
|
|
150
155
|
* A bleed (pt) the page `width` x `height` ALREADY CONTAINS, on the top,
|
|
151
156
|
* bottom and OUTER edges only (the binding edge has none) — how
|
|
152
157
|
* DriveThruRPG's interior file is cut (8.625 x 11.25in for an 8.5 x 11in
|
|
153
|
-
* book). It changes nothing in the PDF: it only tells the preview's
|
|
154
|
-
* & bleed overlay where the trim is.
|
|
155
|
-
* grows the page) wins when the stylesheet declares one.
|
|
158
|
+
* book). It changes nothing in the PDF: it only tells the preview's safe
|
|
159
|
+
* area & bleed overlay where the trim is.
|
|
156
160
|
*/
|
|
157
161
|
bleed?: number;
|
|
162
|
+
/**
|
|
163
|
+
* The safe area's inset (pt) from the trim on every edge: what the
|
|
164
|
+
* preview's overlay outlines as the area content must stay inside. Like
|
|
165
|
+
* `bleed`, overlay-only: it changes nothing in the PDF, and nothing in a
|
|
166
|
+
* book's CSS moves it.
|
|
167
|
+
*/
|
|
168
|
+
safe?: number;
|
|
158
169
|
};
|
|
159
170
|
ink?: {
|
|
160
171
|
maxTac?: number;
|
|
@@ -260,6 +271,7 @@ export interface ResolvedConfig {
|
|
|
260
271
|
icc: string;
|
|
261
272
|
stripAnnotations: boolean;
|
|
262
273
|
blackText: "icc" | "k-only";
|
|
274
|
+
rasterDpi?: number;
|
|
263
275
|
};
|
|
264
276
|
print: {
|
|
265
277
|
signature: number;
|
|
@@ -272,6 +284,8 @@ export interface ResolvedConfig {
|
|
|
272
284
|
tolerance: number;
|
|
273
285
|
/** In-sheet bleed in pt (top, bottom, outer edge; see the manifest field); absent = none. */
|
|
274
286
|
bleed?: number;
|
|
287
|
+
/** Safe-area inset from the trim in pt (see the manifest field); absent = none. */
|
|
288
|
+
safe?: number;
|
|
275
289
|
};
|
|
276
290
|
ink: {
|
|
277
291
|
maxTac: number;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAndReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-x1nfhaf1.js";
|
|
4
4
|
import {
|
|
5
5
|
log
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-mmm22cza.js";
|
|
7
7
|
import {
|
|
8
8
|
UsageError,
|
|
9
9
|
rejectExtraPositionals,
|
|
10
10
|
rejectUnknownFlags
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-7shp2kmj.js";
|
|
12
12
|
import"./cli-ht1bcqdd.js";
|
|
13
|
-
import"./cli-
|
|
13
|
+
import"./cli-rtpm04dv.js";
|
|
14
14
|
import {
|
|
15
15
|
BuildError,
|
|
16
16
|
EXIT_CODES
|
package/package.json
CHANGED