pulpweaver4 0.0.91 → 0.0.185

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.
Files changed (502) hide show
  1. package/dist/ast/djot.js +23 -0
  2. package/dist/ast/djot.js.map +1 -1
  3. package/dist/ast/index.d.ts +1 -0
  4. package/dist/ast/index.js +1 -0
  5. package/dist/ast/index.js.map +1 -1
  6. package/dist/ast/nodes.d.ts +59 -5
  7. package/dist/ast/nodes.js.map +1 -1
  8. package/dist/ast/table.d.ts +27 -0
  9. package/dist/ast/table.js +32 -0
  10. package/dist/ast/table.js.map +1 -0
  11. package/dist/browser.js +2420 -0
  12. package/dist/citations/index.d.ts +1 -1
  13. package/dist/citations/index.js +1 -1
  14. package/dist/citations/index.js.map +1 -1
  15. package/dist/citations/project.d.ts +12 -2
  16. package/dist/citations/project.js +21 -7
  17. package/dist/citations/project.js.map +1 -1
  18. package/dist/colour/images.d.ts +11 -2
  19. package/dist/colour/images.js +53 -3
  20. package/dist/colour/images.js.map +1 -1
  21. package/dist/colour/ink-limit.d.ts +2 -2
  22. package/dist/colour/ink-limit.js +6 -0
  23. package/dist/colour/ink-limit.js.map +1 -1
  24. package/dist/colour/previews.d.ts +8 -4
  25. package/dist/colour/previews.js +11 -8
  26. package/dist/colour/previews.js.map +1 -1
  27. package/dist/config/config.d.ts +91 -3
  28. package/dist/config/config.js +200 -3
  29. package/dist/config/config.js.map +1 -1
  30. package/dist/config/project-schema.d.ts +0 -8
  31. package/dist/config/project-schema.js +207 -12
  32. package/dist/config/project-schema.js.map +1 -1
  33. package/dist/config/schema.js +10 -0
  34. package/dist/config/schema.js.map +1 -1
  35. package/dist/config/secrets.d.ts +11 -0
  36. package/dist/config/secrets.js +19 -0
  37. package/dist/config/secrets.js.map +1 -0
  38. package/dist/csl/project.d.ts +19 -4
  39. package/dist/csl/project.js +23 -10
  40. package/dist/csl/project.js.map +1 -1
  41. package/dist/fonts/index.d.ts +1 -1
  42. package/dist/fonts/index.js +1 -1
  43. package/dist/fonts/index.js.map +1 -1
  44. package/dist/fonts/lint.d.ts +51 -0
  45. package/dist/fonts/lint.js +101 -16
  46. package/dist/fonts/lint.js.map +1 -1
  47. package/dist/fonts/walk.d.ts +13 -0
  48. package/dist/fonts/walk.js +50 -33
  49. package/dist/fonts/walk.js.map +1 -1
  50. package/dist/html/css.d.ts +4 -0
  51. package/dist/html/css.js +11 -3
  52. package/dist/html/css.js.map +1 -1
  53. package/dist/html/dom.d.ts +6 -1
  54. package/dist/html/dom.js +28 -6
  55. package/dist/html/dom.js.map +1 -1
  56. package/dist/html/generated.d.ts +17 -0
  57. package/dist/html/generated.js +21 -0
  58. package/dist/html/generated.js.map +1 -0
  59. package/dist/html/images.d.ts +18 -0
  60. package/dist/html/images.js +49 -2
  61. package/dist/html/images.js.map +1 -1
  62. package/dist/html/index.d.ts +1 -0
  63. package/dist/html/index.js +1 -0
  64. package/dist/html/index.js.map +1 -1
  65. package/dist/html/render.d.ts +5 -4
  66. package/dist/html/render.js +24 -6
  67. package/dist/html/render.js.map +1 -1
  68. package/dist/hyphenation/exceptions.d.ts +5 -0
  69. package/dist/hyphenation/exceptions.js +11 -0
  70. package/dist/hyphenation/exceptions.js.map +1 -1
  71. package/dist/hyphenation/index.d.ts +1 -1
  72. package/dist/hyphenation/index.js +1 -1
  73. package/dist/hyphenation/index.js.map +1 -1
  74. package/dist/import/convert.d.ts +21 -0
  75. package/dist/import/convert.js +65 -0
  76. package/dist/import/convert.js.map +1 -0
  77. package/dist/incremental/cache.d.ts +59 -0
  78. package/dist/incremental/cache.js +64 -0
  79. package/dist/incremental/cache.js.map +1 -0
  80. package/dist/incremental/index.d.ts +3 -0
  81. package/dist/incremental/index.js +4 -0
  82. package/dist/incremental/index.js.map +1 -0
  83. package/dist/incremental/keys.d.ts +27 -0
  84. package/dist/incremental/keys.js +89 -0
  85. package/dist/incremental/keys.js.map +1 -0
  86. package/dist/incremental/session.d.ts +180 -0
  87. package/dist/incremental/session.js +401 -0
  88. package/dist/incremental/session.js.map +1 -0
  89. package/dist/index.d.ts +6 -0
  90. package/dist/index.js +6 -0
  91. package/dist/index.js.map +1 -1
  92. package/dist/indexes/layout.d.ts +8 -2
  93. package/dist/indexes/layout.js +6 -4
  94. package/dist/indexes/layout.js.map +1 -1
  95. package/dist/layout/cache.d.ts +174 -0
  96. package/dist/layout/cache.js +150 -0
  97. package/dist/layout/cache.js.map +1 -0
  98. package/dist/layout/converge.d.ts +28 -0
  99. package/dist/layout/converge.js +102 -9
  100. package/dist/layout/converge.js.map +1 -1
  101. package/dist/layout/counters.d.ts +4 -0
  102. package/dist/layout/counters.js +15 -0
  103. package/dist/layout/counters.js.map +1 -1
  104. package/dist/layout/index.d.ts +5 -2
  105. package/dist/layout/index.js +3 -0
  106. package/dist/layout/index.js.map +1 -1
  107. package/dist/layout/lists.d.ts +52 -3
  108. package/dist/layout/lists.js +513 -46
  109. package/dist/layout/lists.js.map +1 -1
  110. package/dist/layout/lookahead.d.ts +151 -0
  111. package/dist/layout/lookahead.js +581 -0
  112. package/dist/layout/lookahead.js.map +1 -0
  113. package/dist/layout/margin-boxes.d.ts +11 -1
  114. package/dist/layout/margin-boxes.js +24 -1
  115. package/dist/layout/margin-boxes.js.map +1 -1
  116. package/dist/layout/page-rules.d.ts +6 -1
  117. package/dist/layout/page-rules.js +42 -1
  118. package/dist/layout/page-rules.js.map +1 -1
  119. package/dist/layout/page.js +4 -2
  120. package/dist/layout/page.js.map +1 -1
  121. package/dist/layout/pagebuilder.d.ts +248 -3
  122. package/dist/layout/pagebuilder.js +512 -19
  123. package/dist/layout/pagebuilder.js.map +1 -1
  124. package/dist/layout/pages.d.ts +108 -1
  125. package/dist/layout/pages.js +1362 -159
  126. package/dist/layout/pages.js.map +1 -1
  127. package/dist/layout/paragraph.d.ts +14 -0
  128. package/dist/layout/paragraph.js +304 -31
  129. package/dist/layout/paragraph.js.map +1 -1
  130. package/dist/layout/pre.js +4 -0
  131. package/dist/layout/pre.js.map +1 -1
  132. package/dist/layout/protrusion.d.ts +26 -0
  133. package/dist/layout/protrusion.js +39 -0
  134. package/dist/layout/protrusion.js.map +1 -0
  135. package/dist/layout/ranges.d.ts +2 -0
  136. package/dist/layout/ranges.js +22 -0
  137. package/dist/layout/ranges.js.map +1 -0
  138. package/dist/layout/region.d.ts +2 -1
  139. package/dist/layout/region.js +9 -5
  140. package/dist/layout/region.js.map +1 -1
  141. package/dist/layout/templates.d.ts +71 -0
  142. package/dist/layout/templates.js +290 -0
  143. package/dist/layout/templates.js.map +1 -0
  144. package/dist/layout/vlist.d.ts +3 -3
  145. package/dist/linebreak/items.d.ts +27 -2
  146. package/dist/linebreak/items.js +10 -3
  147. package/dist/linebreak/items.js.map +1 -1
  148. package/dist/linebreak/knuth-plass.d.ts +20 -0
  149. package/dist/linebreak/knuth-plass.js +68 -16
  150. package/dist/linebreak/knuth-plass.js.map +1 -1
  151. package/dist/lint/book.d.ts +13 -0
  152. package/dist/lint/book.js +52 -0
  153. package/dist/lint/book.js.map +1 -0
  154. package/dist/lint/config.d.ts +9 -0
  155. package/dist/lint/config.js +40 -6
  156. package/dist/lint/config.js.map +1 -1
  157. package/dist/lint/linter.js +1 -0
  158. package/dist/lint/linter.js.map +1 -1
  159. package/dist/lint/project.js +1 -1
  160. package/dist/lint/project.js.map +1 -1
  161. package/dist/lint/rules/layout.d.ts +3 -1
  162. package/dist/lint/rules/layout.js +8 -6
  163. package/dist/lint/rules/layout.js.map +1 -1
  164. package/dist/lint/rules/source.js +1 -1
  165. package/dist/lint/rules/source.js.map +1 -1
  166. package/dist/lint/testing.js +1 -0
  167. package/dist/lint/testing.js.map +1 -1
  168. package/dist/measure/bidi-data.d.ts +14 -0
  169. package/dist/measure/bidi-data.js +69 -0
  170. package/dist/measure/bidi-data.js.map +1 -0
  171. package/dist/measure/bidi.d.ts +70 -0
  172. package/dist/measure/bidi.js +225 -0
  173. package/dist/measure/bidi.js.map +1 -0
  174. package/dist/measure/css.d.ts +5 -0
  175. package/dist/measure/css.js +2 -0
  176. package/dist/measure/css.js.map +1 -1
  177. package/dist/measure/measurer.d.ts +36 -2
  178. package/dist/measure/measurer.js +220 -22
  179. package/dist/measure/measurer.js.map +1 -1
  180. package/dist/measure/model.d.ts +20 -2
  181. package/dist/measure/model.js +13 -6
  182. package/dist/measure/model.js.map +1 -1
  183. package/dist/measure/script-data.d.ts +6 -0
  184. package/dist/measure/script-data.js +34 -0
  185. package/dist/measure/script-data.js.map +1 -0
  186. package/dist/measure/scripts.d.ts +36 -0
  187. package/dist/measure/scripts.js +293 -0
  188. package/dist/measure/scripts.js.map +1 -0
  189. package/dist/output/output.d.ts +35 -3
  190. package/dist/output/output.js +26 -4
  191. package/dist/output/output.js.map +1 -1
  192. package/dist/paint/backgrounds.js +7 -20
  193. package/dist/paint/backgrounds.js.map +1 -1
  194. package/dist/paint/blend.d.ts +33 -13
  195. package/dist/paint/blend.js +73 -21
  196. package/dist/paint/blend.js.map +1 -1
  197. package/dist/paint/cache.d.ts +80 -0
  198. package/dist/paint/cache.js +537 -0
  199. package/dist/paint/cache.js.map +1 -0
  200. package/dist/paint/canvas.d.ts +4 -13
  201. package/dist/paint/canvas.js +45 -5
  202. package/dist/paint/canvas.js.map +1 -1
  203. package/dist/paint/context.d.ts +2 -0
  204. package/dist/paint/emphasis.js +1 -1
  205. package/dist/paint/emphasis.js.map +1 -1
  206. package/dist/paint/flatten.d.ts +24 -2
  207. package/dist/paint/flatten.js +55 -12
  208. package/dist/paint/flatten.js.map +1 -1
  209. package/dist/paint/forms.d.ts +64 -0
  210. package/dist/paint/forms.js +319 -0
  211. package/dist/paint/forms.js.map +1 -0
  212. package/dist/paint/images.d.ts +4 -1
  213. package/dist/paint/images.js +13 -2
  214. package/dist/paint/images.js.map +1 -1
  215. package/dist/paint/layers.d.ts +64 -0
  216. package/dist/paint/layers.js +137 -0
  217. package/dist/paint/layers.js.map +1 -0
  218. package/dist/paint/painter.d.ts +19 -6
  219. package/dist/paint/painter.js +15 -135
  220. package/dist/paint/painter.js.map +1 -1
  221. package/dist/paint/stacking.d.ts +1 -1
  222. package/dist/paint/stacking.js +9 -2
  223. package/dist/paint/stacking.js.map +1 -1
  224. package/dist/paint/text.d.ts +14 -3
  225. package/dist/paint/text.js +25 -4
  226. package/dist/paint/text.js.map +1 -1
  227. package/dist/paint/vertical.js +2 -2
  228. package/dist/paint/vertical.js.map +1 -1
  229. package/dist/pdf/encoded.d.ts +16 -0
  230. package/dist/pdf/encoded.js +35 -0
  231. package/dist/pdf/encoded.js.map +1 -0
  232. package/dist/pdf/include/colour.d.ts +105 -0
  233. package/dist/pdf/include/colour.js +349 -0
  234. package/dist/pdf/include/colour.js.map +1 -0
  235. package/dist/pdf/include/functions.d.ts +17 -0
  236. package/dist/pdf/include/functions.js +389 -0
  237. package/dist/pdf/include/functions.js.map +1 -0
  238. package/dist/pdf/include/pages.d.ts +14 -0
  239. package/dist/pdf/include/pages.js +27 -0
  240. package/dist/pdf/include/pages.js.map +1 -0
  241. package/dist/pdf/include/pdfjs/LICENSE +177 -0
  242. package/dist/pdf/include/pdfjs/pdf.min.mjs +27 -0
  243. package/dist/pdf/include/pdfjs/pdf.worker.min.mjs +27 -0
  244. package/dist/pdf/include/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  245. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  246. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  247. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  248. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  249. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  250. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  251. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  252. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  253. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  254. package/dist/pdf/include/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  255. package/dist/pdf/include/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  256. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  257. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  258. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  259. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  260. package/dist/pdf/include/pdfjs/wasm/LICENSE_JBIG2 +196 -0
  261. package/dist/pdf/include/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
  262. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  263. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  264. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
  265. package/dist/pdf/include/pdfjs/wasm/LICENSE_QCMS +21 -0
  266. package/dist/pdf/include/pdfjs/wasm/jbig2.wasm +0 -0
  267. package/dist/pdf/include/pdfjs/wasm/openjpeg.wasm +0 -0
  268. package/dist/pdf/include/pdfjs/wasm/qcms_bg.wasm +0 -0
  269. package/dist/pdf/include/pdfjs/wasm/quickjs-eval.wasm +0 -0
  270. package/dist/pdf/include/prepare.d.ts +58 -0
  271. package/dist/pdf/include/prepare.js +266 -0
  272. package/dist/pdf/include/prepare.js.map +1 -0
  273. package/dist/pdf/include/preview.d.ts +38 -0
  274. package/dist/pdf/include/preview.js +101 -0
  275. package/dist/pdf/include/preview.js.map +1 -0
  276. package/dist/pdf/include/rewrite.d.ts +57 -0
  277. package/dist/pdf/include/rewrite.js +803 -0
  278. package/dist/pdf/include/rewrite.js.map +1 -0
  279. package/dist/pdf/include/serialize.d.ts +32 -0
  280. package/dist/pdf/include/serialize.js +158 -0
  281. package/dist/pdf/include/serialize.js.map +1 -0
  282. package/dist/pdf/include/testing.d.ts +26 -0
  283. package/dist/pdf/include/testing.js +50 -0
  284. package/dist/pdf/include/testing.js.map +1 -0
  285. package/dist/pdf/index.d.ts +1 -0
  286. package/dist/pdf/index.js +1 -0
  287. package/dist/pdf/index.js.map +1 -1
  288. package/dist/pdf/structure/annotations.d.ts +33 -0
  289. package/dist/pdf/structure/annotations.js +112 -0
  290. package/dist/pdf/structure/annotations.js.map +1 -0
  291. package/dist/pdf/structure/forms.d.ts +10 -0
  292. package/dist/pdf/structure/forms.js +46 -0
  293. package/dist/pdf/structure/forms.js.map +1 -0
  294. package/dist/pdf/structure/index.d.ts +41 -5
  295. package/dist/pdf/structure/index.js +40 -5
  296. package/dist/pdf/structure/index.js.map +1 -1
  297. package/dist/pdf/structure/links.d.ts +2 -0
  298. package/dist/pdf/structure/links.js +1 -1
  299. package/dist/pdf/structure/links.js.map +1 -1
  300. package/dist/pdf/structure/presentation.d.ts +28 -0
  301. package/dist/pdf/structure/presentation.js +79 -0
  302. package/dist/pdf/structure/presentation.js.map +1 -0
  303. package/dist/pdf/structure/tags.d.ts +34 -2
  304. package/dist/pdf/structure/tags.js +117 -14
  305. package/dist/pdf/structure/tags.js.map +1 -1
  306. package/dist/pdf/types.d.ts +357 -11
  307. package/dist/pdf/wasm/pulpweaver4_pdf.d.ts +44 -2
  308. package/dist/pdf/wasm/pulpweaver4_pdf.js +191 -2
  309. package/dist/pdf/wasm/pulpweaver4_pdf_bg.wasm +0 -0
  310. package/dist/pdf/writer.d.ts +13 -1
  311. package/dist/pdf/writer.js +26 -1
  312. package/dist/pdf/writer.js.map +1 -1
  313. package/dist/plugin/define.d.ts +200 -15
  314. package/dist/plugin/define.js +124 -15
  315. package/dist/plugin/define.js.map +1 -1
  316. package/dist/plugin/failure.d.ts +1 -1
  317. package/dist/plugin/index.d.ts +5 -4
  318. package/dist/plugin/index.js +5 -4
  319. package/dist/plugin/index.js.map +1 -1
  320. package/dist/plugin/reference.d.ts +38 -0
  321. package/dist/plugin/reference.js +287 -0
  322. package/dist/plugin/reference.js.map +1 -0
  323. package/dist/plugin/register.d.ts +39 -7
  324. package/dist/plugin/register.js +83 -2
  325. package/dist/plugin/register.js.map +1 -1
  326. package/dist/preflight/index.d.ts +1 -1
  327. package/dist/preflight/index.js +1 -1
  328. package/dist/preflight/index.js.map +1 -1
  329. package/dist/preflight/pdfx.d.ts +35 -0
  330. package/dist/preflight/pdfx.js +33 -2
  331. package/dist/preflight/pdfx.js.map +1 -1
  332. package/dist/preflight/reader.d.ts +10 -3
  333. package/dist/preflight/reader.js +86 -5
  334. package/dist/preflight/reader.js.map +1 -1
  335. package/dist/print/impose.d.ts +66 -0
  336. package/dist/print/impose.js +331 -0
  337. package/dist/print/impose.js.map +1 -0
  338. package/dist/print/output.js +400 -50
  339. package/dist/print/output.js.map +1 -1
  340. package/dist/problem.js +4 -3
  341. package/dist/problem.js.map +1 -1
  342. package/dist/profile/index.d.ts +1 -0
  343. package/dist/profile/index.js +1 -0
  344. package/dist/profile/index.js.map +1 -1
  345. package/dist/profile/lint.d.ts +1 -1
  346. package/dist/profile/lint.js +29 -1
  347. package/dist/profile/lint.js.map +1 -1
  348. package/dist/profile/list-table.d.ts +51 -0
  349. package/dist/profile/list-table.js +137 -0
  350. package/dist/profile/list-table.js.map +1 -0
  351. package/dist/profile/metadata.js +3 -0
  352. package/dist/profile/metadata.js.map +1 -1
  353. package/dist/profile/profile.d.ts +3 -0
  354. package/dist/profile/profile.js +9 -1
  355. package/dist/profile/profile.js.map +1 -1
  356. package/dist/project.js +3 -0
  357. package/dist/project.js.map +1 -1
  358. package/dist/qpdf/index.d.ts +2 -0
  359. package/dist/qpdf/index.js +3 -0
  360. package/dist/qpdf/index.js.map +1 -0
  361. package/dist/qpdf/qpdf.d.ts +125 -0
  362. package/dist/qpdf/qpdf.js +205 -0
  363. package/dist/qpdf/qpdf.js.map +1 -0
  364. package/dist/qpdf/testing.d.ts +12 -0
  365. package/dist/qpdf/testing.js +9 -0
  366. package/dist/qpdf/testing.js.map +1 -0
  367. package/dist/qpdf/wasm/LICENSE-qpdf +202 -0
  368. package/dist/qpdf/wasm/LICENSE-zlib +22 -0
  369. package/dist/qpdf/wasm/NOTICE-qpdf.md +42 -0
  370. package/dist/qpdf/wasm/qpdf.wasm +0 -0
  371. package/dist/render/index.d.ts +3 -0
  372. package/dist/render/index.js +2 -0
  373. package/dist/render/index.js.map +1 -0
  374. package/dist/render/render.d.ts +98 -0
  375. package/dist/render/render.js +243 -0
  376. package/dist/render/render.js.map +1 -0
  377. package/dist/reproducible/clock.d.ts +4 -5
  378. package/dist/reproducible/clock.js +4 -5
  379. package/dist/reproducible/clock.js.map +1 -1
  380. package/dist/spike/spike-page.chromium.json +4 -4
  381. package/dist/style/colours.d.ts +7 -2
  382. package/dist/style/colours.js +24 -2
  383. package/dist/style/colours.js.map +1 -1
  384. package/dist/style/compile.js +1 -1
  385. package/dist/style/compile.js.map +1 -1
  386. package/dist/style/defaults.d.ts +9 -3
  387. package/dist/style/defaults.js +14 -2
  388. package/dist/style/defaults.js.map +1 -1
  389. package/dist/style/gcpm.d.ts +1 -1
  390. package/dist/style/gcpm.js +17 -5
  391. package/dist/style/gcpm.js.map +1 -1
  392. package/dist/style/properties.js +84 -0
  393. package/dist/style/properties.js.map +1 -1
  394. package/dist/test/book.d.ts +22 -2
  395. package/dist/test/book.js +35 -2
  396. package/dist/test/book.js.map +1 -1
  397. package/dist/test/build.d.ts +23 -0
  398. package/dist/test/build.js +86 -33
  399. package/dist/test/build.js.map +1 -1
  400. package/dist/test/layout.js +128 -19
  401. package/dist/test/layout.js.map +1 -1
  402. package/dist/test/limits.d.ts +8 -0
  403. package/dist/test/limits.js +9 -0
  404. package/dist/test/limits.js.map +1 -0
  405. package/dist/test/pipeline.d.ts +23 -0
  406. package/dist/test/pipeline.js.map +1 -1
  407. package/dist/test/render.d.ts +26 -3
  408. package/dist/test/render.js +151 -23
  409. package/dist/test/render.js.map +1 -1
  410. package/dist/test/runner.d.ts +6 -3
  411. package/dist/test/runner.js +172 -105
  412. package/dist/test/runner.js.map +1 -1
  413. package/dist/test/text.js +2 -2
  414. package/dist/test/text.js.map +1 -1
  415. package/dist/text/output.js +2 -2
  416. package/dist/text/output.js.map +1 -1
  417. package/dist/text/render.d.ts +4 -3
  418. package/dist/text/render.js +126 -4
  419. package/dist/text/render.js.map +1 -1
  420. package/dist/transform/index.d.ts +1 -1
  421. package/dist/transform/index.js +1 -1
  422. package/dist/transform/index.js.map +1 -1
  423. package/dist/transform/run.d.ts +2 -0
  424. package/dist/transform/run.js +32 -16
  425. package/dist/transform/run.js.map +1 -1
  426. package/dist/web/output.js +116 -10
  427. package/dist/web/output.js.map +1 -1
  428. package/dist/web/runtime/justify.js.txt +2 -2
  429. package/dist/web/site.d.ts +2 -0
  430. package/dist/web/site.js +8 -1
  431. package/dist/web/site.js.map +1 -1
  432. package/docs/README.md +6 -1
  433. package/docs/manual/chapters/front.dj +34 -0
  434. package/docs/manual/chapters/guides/citations.dj +426 -0
  435. package/docs/manual/chapters/guides/colour-and-prepress.dj +261 -0
  436. package/docs/manual/chapters/guides/editions.dj +329 -0
  437. package/docs/manual/chapters/guides/in-a-web-page.dj +143 -0
  438. package/docs/manual/chapters/guides/lines-and-pages.dj +681 -0
  439. package/docs/manual/chapters/guides/lint-rules.dj +355 -0
  440. package/docs/manual/chapters/guides/pdfs.dj +501 -0
  441. package/docs/manual/chapters/guides/plugins.dj +425 -0
  442. package/docs/manual/chapters/guides/testing.dj +264 -0
  443. package/docs/manual/chapters/guides/writing-in-djot.dj +537 -0
  444. package/docs/manual/chapters/start/for-latex-users.dj +256 -0
  445. package/docs/manual/chapters/start/getting-started.dj +167 -0
  446. package/docs/manual/chapters/start/your-first-book.dj +426 -0
  447. package/docs/manual/fonts/CrimsonPro-Italic-VF.ttf +0 -0
  448. package/docs/manual/fonts/CrimsonPro-VF.ttf +0 -0
  449. package/docs/manual/fonts/JetBrainsMono-Regular.otf +0 -0
  450. package/docs/manual/fonts/NotoSansSymbols2-Boxes.ttf +0 -0
  451. package/docs/manual/fonts/OFL.txt +95 -0
  452. package/docs/manual/pulpweaver4.toml +39 -0
  453. package/docs/manual/styles/manual.css +137 -0
  454. package/docs/reference/css-properties/index.md +9 -0
  455. package/docs/reference/css-properties/pw-expansion.md +31 -0
  456. package/docs/reference/css-properties/pw-flow-into.md +31 -0
  457. package/docs/reference/css-properties/pw-knockout.md +26 -0
  458. package/docs/reference/css-properties/pw-layer.md +24 -0
  459. package/docs/reference/css-properties/pw-page-breaking.md +30 -0
  460. package/docs/reference/css-properties/pw-page-duration.md +28 -0
  461. package/docs/reference/css-properties/pw-page-rotate.md +29 -0
  462. package/docs/reference/css-properties/pw-page-transition.md +29 -0
  463. package/docs/reference/css-properties/pw-protrusion.md +31 -0
  464. package/docs/reference/lint-rules/ibid-across-page.md +2 -2
  465. package/docs/reference/plugin-api/capabilities.md +2 -2
  466. package/docs/reference/plugin-api/claim-kind.md +1 -1
  467. package/docs/reference/plugin-api/combine-exceptions.md +19 -0
  468. package/docs/reference/plugin-api/element-break-context.md +34 -0
  469. package/docs/reference/plugin-api/element-break-item.md +24 -0
  470. package/docs/reference/plugin-api/element-breaker.md +24 -0
  471. package/docs/reference/plugin-api/flow-definition.md +30 -0
  472. package/docs/reference/plugin-api/generated-reference.md +32 -0
  473. package/docs/reference/plugin-api/index-definition.md +32 -0
  474. package/docs/reference/plugin-api/index-titles.md +18 -0
  475. package/docs/reference/plugin-api/index.md +27 -3
  476. package/docs/reference/plugin-api/insert-class-definition.md +46 -0
  477. package/docs/reference/plugin-api/insert-placement.md +22 -0
  478. package/docs/reference/plugin-api/insert-placements.md +18 -0
  479. package/docs/reference/plugin-api/layout-definition.md +9 -5
  480. package/docs/reference/plugin-api/layout-slot.md +6 -16
  481. package/docs/reference/plugin-api/lint-context.md +3 -1
  482. package/docs/reference/plugin-api/lint-definition.md +1 -1
  483. package/docs/reference/plugin-api/lint-edition.md +2 -0
  484. package/docs/reference/plugin-api/page-builder-event.md +22 -0
  485. package/docs/reference/plugin-api/page-builder-hook.md +7 -3
  486. package/docs/reference/plugin-api/page-builder-page-event.md +30 -0
  487. package/docs/reference/plugin-api/page-template-definition.md +34 -0
  488. package/docs/reference/plugin-api/page-template-region-definition.md +46 -0
  489. package/docs/reference/plugin-api/plugin-definition.md +5 -1
  490. package/docs/reference/plugin-api/plugin-reference-options.md +32 -0
  491. package/docs/reference/plugin-api/plugin-reference.md +22 -0
  492. package/docs/reference/plugin-api/plugin-registry.md +15 -5
  493. package/docs/reference/plugin-api/plugin-stage.md +1 -1
  494. package/docs/reference/plugin-api/plugin.md +9 -2
  495. package/docs/reference/plugin-api/reference-page.md +34 -0
  496. package/docs/reference/plugin-api/render-reference-page.md +18 -0
  497. package/docs/reference/plugin-api/renderers.md +1 -1
  498. package/docs/reference/pulpweaver4-toml/editions.md +239 -2
  499. package/docs/reference/pulpweaver4-toml/index.md +44 -1
  500. package/docs/reference/pulpweaver4-toml/inks.md +15 -4
  501. package/docs/reference/pulpweaver4-toml/lint.md +1 -1
  502. package/package.json +5 -1
@@ -0,0 +1,501 @@
1
+ ``` =meta
2
+ description = 'What a pulpweaver4 PDF holds — embedded fonts, links, bookmarks and tags — and how to make PDF/A, PDF/UA and PDF/X, with reproducible dates, checked by pw preflight.'
3
+ ```
4
+
5
+ {#pdfs}
6
+ # PDFs
7
+
8
+ Every print edition is a PDF, written by pulpweaver4’s own PDF writer from
9
+ the laid-out pages: not by a browser’s print dialog, whose headers, margins
10
+ and scaling would spoil the page, and which can’t write CMYK. The same
11
+ writer runs on the command line and in the browser app, so a PDF is the
12
+ same wherever it is made.
13
+
14
+ {#what-every-pdf-has}
15
+ ## What every PDF has
16
+
17
+ Build the starter project and its `dist/paperback/paperback.pdf` already
18
+ has:
19
+
20
+ - *Its fonts embedded*, subset to the characters the book uses, as
21
+ TrueType or OpenType outlines with a Unicode map, so its text can be
22
+ searched, copied and read aloud. The fonts are the project’s own files,
23
+ never the system’s.
24
+ - *Links*: cross-references, footnote calls and URLs are clickable.
25
+ - *Bookmarks* from the headings, nested by level, with their numbers
26
+ (“1 The Beginning”), and a named destination for every label.
27
+ - *Tags*: the PDF is tagged from the book’s HTML, headings, paragraphs,
28
+ lists, notes, figures with their alt text, in reading order, so a screen
29
+ reader can read it.
30
+ - *Page labels*, so a viewer’s page numbers are the book’s: each page is
31
+ labelled as its folio counts it (i, ii, iii in roman front matter, then
32
+ 1, 2, 3), with any `--pw-page-prefix` its `@page` rules give it (A-1, A-2).
33
+ - *Its title and language*, from `title` and `language` in
34
+ `pulpweaver4.toml`.
35
+
36
+ Math is drawn as vector paths, with its spoken form for screen readers.
37
+ Images are PNG, JPEG, GIF or WebP, or a PDF, drawn as vectors
38
+ ([below](#pdf-images)). A scan in
39
+ JBIG2 (`![](scan.jb2)`, or `.jbig2`) or a photograph in JPEG 2000
40
+ (`![](photo.jp2)`, `.jpx` or `.j2k`) goes into the PDF as it is, where its
41
+ standard allows the format: JBIG2 everywhere but PDF/X-1a and X-3, JPEG
42
+ 2000 from PDF 1.5, so not in PDF/A-1 or those two PDF/X parts. Where it
43
+ doesn’t, it is decoded and written as its pixels, in a CMYK edition
44
+ converted to its output intent. No browser shows either format, so the
45
+ preview, the layout, which sizes the image by its pixels, and the web
46
+ edition (`scan.jb2.png`) show a PNG of it instead. An SVG image (`![](diagram.svg)`) is
47
+ drawn by the browser at the edition’s resolution, so for a vector drawing
48
+ put the SVG in the HTML itself through a plugin; that is painted as vectors.
49
+ HTML in such an SVG’s `<foreignObject>` is painted as the rest of the page
50
+ is, its boxes as vectors and its text as text in the edition’s fonts, where
51
+ the SVG puts it and at the opacity of the groups around it. A clip, mask or
52
+ filter on a group around a `<foreignObject>` isn’t painted on its HTML: put
53
+ it on an element inside, or on the whole SVG. That is an `unpaintable`
54
+ error, coded `foreign-object-effect`.
55
+
56
+ The rest of the page’s CSS is painted as the browser shows it, in vectors
57
+ where a PDF can hold it: backgrounds, borders, gradients, box shadows, text
58
+ decorations (where Chromium draws them, beside vertical text as beside
59
+ horizontal) and text shadows, which underlines and line-throughs cast as
60
+ well as the glyphs. CSS masks are painted with every `mask-composite`
61
+ operator, `add`, `subtract`, `intersect` and `exclude`, each layer by its
62
+ own `mask-mode`, as the browser shows them on screen (Chromium’s own print
63
+ gets all but `add` wrong). Ruby is painted where the browser draws it, in
64
+ Firefox as in Chromium. An element under a CSS `filter` is rasterized, its
65
+ text in the edition’s own fonts. What a PDF can’t show as the browser does,
66
+ such as a 3D transform or `backdrop-filter`, is the `unpaintable` lint
67
+ error.
68
+
69
+ A gradient repeated by `background-size` is drawn tile by tile, up to 400
70
+ tiles, not as one PDF pattern: Poppler, the renderer of Evince and Okular,
71
+ draws such a pattern with gaps when it is scaled or turned. The PDF is a
72
+ little bigger for it
73
+ ([#127](https://gitlab.com/inkylabs/pulpweaver4/-/issues/127)).
74
+
75
+ {#pdf-images}
76
+ ## PDFs as images
77
+
78
+ A PDF is an image as LaTeX’s `\includegraphics` takes one: its first page,
79
+ drawn as vectors with its own fonts and colours, at its size unless CSS
80
+ sizes it. `#page=2` takes another page. Alone in its paragraph with
81
+ `{.pages}`, a PDF’s pages are included whole, as `pdfpages` includes them,
82
+ each a page of the book that it fills, with no running heads or folio;
83
+ `#page=1-3,5` takes some of them:
84
+
85
+ {.untested}
86
+ ``` djot
87
+ ![The press, drawn in 1840.](figures/press.pdf)
88
+
89
+ ![The order form’s back.](figures/form.pdf#page=2)
90
+
91
+ ![The order form.](figures/form.pdf){.pages}
92
+ ```
93
+
94
+ A plain RGB edition draws the file as it is. A CMYK edition, or one that
95
+ claims PDF/A, PDF/UA or PDF/X, converts its pages to the edition’s colour
96
+ and checks them against what the edition claims; what breaks a rule, a
97
+ font that isn’t embedded in PDF/X say, is an error naming the file, and the
98
+ PDF isn’t written. A PDF image keeps its [layers](#pdf-layers).
99
+
100
+ {#the-date-and-builds-you-can-repeat}
101
+ ## The date, and builds you can repeat
102
+
103
+ A PDF records when it was made. pulpweaver4 never takes that from the
104
+ clock, so the same book, fonts and version always give the same bytes. It
105
+ takes it from the project:
106
+
107
+ {project=archive}
108
+ ``` toml
109
+ date = "2026-11-13" # a day
110
+ # date = "2026-11-13T09:30:00-08:00" # or a time with its offset from UTC
111
+ ```
112
+
113
+ Without `date`, a build takes `SOURCE_DATE_EPOCH` from the environment, in
114
+ seconds since 1970 as [reproducible
115
+ builds](https://reproducible-builds.org/specs/source-date-epoch/) define it.
116
+ With neither, the PDF has no date at all, which is fine for most uses but
117
+ not for PDF/X.
118
+
119
+ {#standards}
120
+ ## Standards
121
+
122
+ `pdf-standard` on a print edition makes its PDF claim a standard, and meet
123
+ it:
124
+
125
+ {project=archive}
126
+ ``` toml
127
+ [editions.archive]
128
+ media = "print"
129
+ page = "letter"
130
+ pdf-standard = ["PDF/A-2a", "PDF/UA-1"]
131
+ ```
132
+
133
+ | Standard | For | Values |
134
+ |----|----|----|
135
+ | PDF/A | Archiving: everything embedded, nothing that depends on the reader’s machine | `PDF/A-1a`, `-1b`, `-2a`, `-2b`, `-2u`, `-3a`, `-3b`, `-3u`, `-4`, `-4e`, `-4f` |
136
+ | PDF/UA | Accessibility: tagged, with alt text and a reading order | `PDF/UA-1` |
137
+ | PDF/X | Printing: a printer’s colour profile, embedded fonts, no surprises at the press | `PDF/X-1a`, `PDF/X-3`, `PDF/X-4` |
138
+
139
+ - *One standard of each family*, in an array: `["PDF/A-2a", "PDF/UA-1"]`
140
+ is an accessible archive, `["PDF/X-4", "PDF/UA-1"]` an accessible print
141
+ file. Two PDF/A levels at once is an error.
142
+ - *Each sets the PDF’s version*: PDF/A-1 and PDF/X-1a are PDF 1.4,
143
+ PDF/X-4 is 1.6, PDF/A-2 and -3 are 1.7, PDF/A-4 is 2.0.
144
+ - *Standards with no PDF version in common can’t be combined*, and the
145
+ build says what to claim instead: PDF/X-4 for X-1a or X-3 with PDF/UA-1
146
+ (which is PDF 1.5 to 1.7), PDF/A-2 for A-1, and A-2b or A-3b for A-4
147
+ with PDF/UA-1 or PDF/X.
148
+ - *PDF/A works in a CMYK edition* too, writing the colours the output
149
+ intent describes, as PDF/X does. PDF/A-1, being PDF 1.4, needs an ICC
150
+ version 2 profile, such as `FOGRA39`.
151
+
152
+ {#pdfx}
153
+ ### PDF/X
154
+
155
+ PDF/X is what a commercial printer asks for. It needs a CMYK edition with a
156
+ printer’s profile, and a date, `date` as [above](#the-date-and-builds-you-can-repeat):
157
+
158
+ {project=pdfx}
159
+ ``` toml
160
+ [editions.offset]
161
+ media = "print"
162
+ page = "5.5in 8.5in"
163
+ color = "cmyk"
164
+ output-intent = "GRACoL2013"
165
+ pdf-standard = "PDF/X-4"
166
+ ```
167
+
168
+ [Colour and prepress](#colour-and-prepress) explains `color` and
169
+ `output-intent`. A PDF/X edition:
170
+
171
+ - *Embeds the profile* as its output intent, which makes the file a couple
172
+ of megabytes bigger than an RGB edition’s, unless it names a registered
173
+ condition alone.
174
+ - *Has no links*, as PDF/X requires; bookmarks and tags stay.
175
+ - *Has its trim box*, the page’s size, its bleed box if it has bleed, and
176
+ the `Trapped` key.
177
+ - *For PDF/X-1a and X-3, has no transparency*: pulpweaver4 blends
178
+ transparent colours, shadows and images into what is under them, and where
179
+ that isn’t one colour, draws the region as an image. Prefer PDF/X-4, which
180
+ keeps transparency, unless your printer asks for X-1a.
181
+ - *For PDF/X-1a and X-3, has an ICC version 2 profile*, as ISO 15930-4
182
+ and -6 require, or names a registered condition without one (below);
183
+ PDF/X-4 takes version 2 or 4.0 to 4.2, and always embeds it.
184
+
185
+ The build stops on a PDF/X edition it can’t make, with the fix. Without a
186
+ date:
187
+
188
+ {project=pdfx output="pw build --edition offset"}
189
+ ``` text
190
+ pulpweaver4.toml:30:16: error: PDF/X-4 needs the date the file was made, and the build has none [pdf-x-date]
191
+ ...
192
+ fix: set date in pulpweaver4.toml, or SOURCE_DATE_EPOCH
193
+
194
+ 1 error
195
+ pw build: offset: nothing written
196
+ pw build: failed, with 1 error
197
+ ```
198
+
199
+ With GRACoL 2013’s profile, which is version 4.2, a PDF/X-1a edition is
200
+ refused, with what to use instead:
201
+
202
+ {project=x1a}
203
+ ``` toml
204
+ date = "2026-11-13"
205
+
206
+ [editions.offset]
207
+ media = "print"
208
+ page = "5.5in 8.5in"
209
+ color = "cmyk"
210
+ output-intent = "GRACoL2013"
211
+ pdf-standard = "PDF/X-1a"
212
+ ```
213
+
214
+ {project=x1a output="pw build --edition offset"}
215
+ ``` text
216
+ pulpweaver4.toml:31:17: error: PDF/X-1a’s output intent is an ICC profile of version 2, as ICC.1:1998 defines it, and GRACoL2013’s is version 4.2 [pdf-x-profile]
217
+ ...
218
+ fix: use "PDF/X-4", which takes it, a version 2 profile, such as "FOGRA39", or output-profile = "registered", which names the condition without its profile
219
+
220
+ 1 error
221
+ pw build: offset: nothing written
222
+ pw build: failed, with 1 error
223
+ ```
224
+
225
+ {#a-registered-condition-without-its-profile}
226
+ ### A registered condition, without its profile
227
+
228
+ PDF/X-1a and X-3 can name the printing condition instead of embedding its
229
+ profile, when the condition is in the ICC’s registry: the PDF says
230
+ `CGATS21-2-CRPC6` (GRACoL 2013) or `FOGRA39`, and the printer, who has the
231
+ profile, prints to it. That is how a PDF/X-1a edition can be for GRACoL
232
+ 2013, whose version 4.2 profile it can’t embed:
233
+
234
+ {project=x1a-registered}
235
+ ``` toml
236
+ date = "2026-11-13"
237
+
238
+ [editions.offset]
239
+ media = "print"
240
+ page = "5.5in 8.5in"
241
+ color = "cmyk"
242
+ output-intent = "GRACoL2013"
243
+ output-profile = "registered"
244
+ pdf-standard = "PDF/X-1a"
245
+ ```
246
+
247
+ `output-profile` is `embedded` by default. With `registered`:
248
+
249
+ - *The build still uses the profile.* Colours and images are converted to
250
+ CMYK through it, and the ink limit is its, exactly as when it is embedded,
251
+ so it is fetched (and cached) the same way; only the PDF leaves it out.
252
+ A build that can’t get the profile stops, as any CMYK build does.
253
+ - *Its version doesn’t matter*, as the file doesn’t carry it.
254
+ - *Any condition known by name will do* (`GRACoL2013`, `FOGRA39`,
255
+ `FOGRA51`, `SWOP`), or a file whose bytes are one of theirs. A printer’s
256
+ own profile is in no registry, so it must be embedded: the build stops
257
+ with `pdf-unregistered-intent`.
258
+ - *PDF/X-4 and PDF/A need the profile in the file*, so the configuration
259
+ refuses `registered` with them, at `output-profile`.
260
+ - *In PDF/X-3, every colour is CMYK*: without the profile nothing may be
261
+ device independent, which a CMYK edition already is.
262
+
263
+ pulpweaver4’s [example book](https://gitlab.com/inkylabs/pulpweaver4/-/tree/v0.0.91/examples/book)’s
264
+ `offset-x1a-gracol` edition is this; its `offset-x1a`
265
+ embeds FOGRA39’s profile instead. Ask the printer which they want: some
266
+ workflows read only an embedded profile.
267
+
268
+ `output-intent = "sRGB"` with PDF/X is an error too: sRGB is a display’s
269
+ profile, and PDF/X needs the printer’s. If the PDF writer itself finds the
270
+ file can’t meet the standard, the build says why in words, with the fix,
271
+ rather than writing a file that only claims it.
272
+
273
+ {#checking-a-pdfx}
274
+ ### Checking a PDF/X
275
+
276
+ There is no free PDF/X validator, so pulpweaver4 has its own checker, every
277
+ rule of ISO 15930-4, -6 and -7 (PDF/X-1a:2003, X-3:2003 and X-4) that a
278
+ file can show, each naming its clause, which its own tests hold every PDF/X
279
+ to:
280
+
281
+ {.untested}
282
+ ``` sh
283
+ pw preflight dist/offset/offset.pdf
284
+ ```
285
+
286
+ {.untested}
287
+ ``` text
288
+ dist/offset/offset.pdf: no PDF/X-4 violations
289
+ ```
290
+
291
+ It checks the standard the file claims, or the one given with `--standard`
292
+ (`PDF/X-1a:2001`, `PDF/X-1a:2003`, `PDF/X-3:2002`, `PDF/X-3:2003` or
293
+ `PDF/X-4`), and `--output CMYK` requires a CMYK output intent. It works on
294
+ any PDF, not only pulpweaver4’s. A press’s own preflight remains the last
295
+ word: the checker hasn’t yet been compared with a commercial one.
296
+
297
+ For PDF/A and PDF/UA, [veraPDF](https://verapdf.org) is the free validator;
298
+ pulpweaver4’s tests check its PDFs with it.
299
+
300
+ {#form-fields}
301
+ ## Form fields
302
+
303
+ An `input`, `textarea`, `select` or `button` on a page, as a plugin
304
+ renders one, is a form field in the PDF, which a reader fills in on
305
+ screen: a workbook’s answer blanks, say, with its value painted in the
306
+ project’s faces for a leader’s guide that shows the answers. Radio buttons
307
+ of one name are one field, and a control’s accessible name is its field’s
308
+ tooltip. A PDF/UA edition tags each field; PDF/X allows no field on the
309
+ page, so there the controls are painted as they look, and PDF/A-4 refuses
310
+ them.
311
+
312
+ {#pdf-layers}
313
+ ## Layers
314
+
315
+ `--pw-layer` puts an element in a layer, an optional content group a PDF
316
+ viewer lists and lets the reader hide or show, as LaTeX’s `ocgx2` does:
317
+ a workbook’s answers, say, or a map’s labels. Add `hidden` and the layer
318
+ starts hidden:
319
+
320
+ {project=layers}
321
+ ``` css
322
+ .answer { --pw-layer: "Answer key" hidden; }
323
+ .diagram { --pw-layer: Diagram; }
324
+ .answer .hint { --pw-layer: none; }
325
+ ```
326
+
327
+ A layer holds what its elements paint: their text, backgrounds, borders
328
+ and images. The property is inherited, so what is inside an element is in
329
+ its layer, unless it names another layer or `none`. A layer starts hidden
330
+ if any of its elements says `hidden`. The preview leaves out what starts
331
+ hidden, as a viewer opens the file. Layers need PDF 1.5, so PDF/A-1 and
332
+ PDF/X-1a and X-3 refuse them. A PDF image (`![](figure.pdf)`) keeps the
333
+ layers it has, in every edition, and which of them start hidden.
334
+
335
+ {#encryption}
336
+ ## Encryption
337
+
338
+ Where LaTeX has `\pdfprotect`, an edition has `encryption`, which encrypts
339
+ its PDF with AES-256. Its `user-password` is what a reader types to open
340
+ the file, and its `owner-password` what lifts its `permissions`:
341
+
342
+ {project=layers}
343
+ ``` toml
344
+ [editions.review]
345
+ media = "print"
346
+ page = "letter"
347
+ encryption = { user-password = "for-reviewers" }
348
+
349
+ [editions.handout]
350
+ media = "print"
351
+ page = "letter"
352
+ encryption = { owner-password = "for-the-publisher", permissions = ["print", "copy"] }
353
+ ```
354
+
355
+ The review copy asks for its password; the handout opens without one, and a
356
+ reader that honours permissions lets its reader print it and copy from it
357
+ but not change it. The permissions are `print`, `print-low`, `copy`,
358
+ `annotate`, `fill-forms`, `assemble` and `modify`, and what isn’t listed is
359
+ withheld, so a file that withholds any needs an owner password. A screen
360
+ reader may always read it, as PDF/UA asks. PDF/A and PDF/X forbid
361
+ encryption, and an edition that claims one and asks for it is an error.
362
+ The passwords are in `pulpweaver4.toml`, so anyone with the project has
363
+ them; the build never prints them.
364
+
365
+ Two more keys change how the file is written, after it is: `linearize =
366
+ true` puts its first page first, so a browser shows it while the rest
367
+ downloads (“fast web view”), and `object-streams = true` packs its objects
368
+ into compressed streams, a smaller file that PDF/A-1, PDF/X-1a and X-3
369
+ forbid.
370
+
371
+ The browser app and `pw dev` write the same file `pw build` does, each
372
+ edition a download in one click
373
+ ([Watching as you write](#watching-as-you-write)).
374
+
375
+ {#comments-and-attachments}
376
+ ## Comments and attached files
377
+
378
+ `comment` on a span or a block makes it a comment, as LaTeX’s
379
+ `pdfcomment` and `todonotes` do: a note icon in the margin before its first
380
+ line, which a viewer opens to show the text. `attach` attaches a file of
381
+ the project over the text, as `attachfile` does: a viewer offers the file
382
+ when the reader clicks there. It draws nothing of its own, as a link
383
+ doesn’t, so style the element to show it:
384
+
385
+ {.untested}
386
+ ``` djot
387
+ Christian set out in [the year of the dream]{comment="Check the date"},
388
+ and the reckoning he kept is in [the table of days]{attach="data/days.csv"}.
389
+ ```
390
+
391
+ The file is found as an image is, beside the chapter or from the
392
+ project’s root; one that isn’t there is a `missing-attachment` error. Its
393
+ description is the element’s text. Each is on the first page its element
394
+ is on, and a tagged PDF has it in an `Annot` element where the element is
395
+ read, as PDF/UA asks. PDF/X allows no annotation where the page is printed,
396
+ so a PDF/X edition leaves them out, each an `annotation-left-out` warning;
397
+ PDF/A-1 and PDF/A-4 refuse an attached file, and PDF/A-2 takes only one
398
+ that is itself PDF/A. Keep comments to the editions that want them with
399
+ `{.edition-<name>}`.
400
+
401
+ An edition can carry files of its own, which a viewer lists, as
402
+ `attachfile2` and `embedfile` attach them, each by its path from the
403
+ project’s root:
404
+
405
+ {.untested}
406
+ ``` toml
407
+ [editions.archive.attachments]
408
+ "data/days.csv" = {}
409
+ "invoice/factur-x.xml" = { relationship = "alternative", description = "The invoice, as Factur-X XML" }
410
+ ```
411
+
412
+ PDF/A-3 records each as an associated file of the document, with its
413
+ `relationship` (`supplement` unless it says), as Factur-X and ZUGFeRD
414
+ need; PDF/A-1, PDF/A-2 and PDF/X carry none. The media type is the
415
+ extension’s, or `media-type` says it.
416
+
417
+ {#custom-xmp}
418
+ ## Custom XMP
419
+
420
+ `[editions.<name>.xmp.<prefix>]` adds a namespace of XMP metadata, its
421
+ URI in `namespace` and each property a text value, as `pdfx`’s `.xmpdata`
422
+ does. A Factur-X invoice names its XML this way:
423
+
424
+ {.untested}
425
+ ``` toml
426
+ [editions.archive.xmp.fx]
427
+ namespace = "urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#"
428
+ schema = "Factur-X PDFA Extension Schema"
429
+ DocumentType = "INVOICE"
430
+ DocumentFileName = "factur-x.xml"
431
+ Version = "1.0"
432
+ ConformanceLevel = "MINIMUM"
433
+ ```
434
+
435
+ PDF/A-1 to A-3 get a description of each namespace, as they require
436
+ (`schema` names it). The prefixes the writer uses itself, such as `dc`,
437
+ `xmp` and `pdfaid`, are taken.
438
+
439
+ {#slides-and-viewer-settings}
440
+ ## Slides, and how a viewer opens the PDF
441
+
442
+ A PDF viewer’s presentation, as `beamer`’s slides use it, moves on from a
443
+ page after its `--pw-page-duration` and reveals it with its
444
+ `--pw-page-transition`, set in `@page` rules; `--pw-page-rotate` turns a
445
+ page as the viewer shows it, as `pdflscape` turns a landscape table, while
446
+ it is laid out and printed as it is. Name the pages that differ, as any
447
+ named page:
448
+
449
+ {project=slides}
450
+ ``` css
451
+ section { break-before: page; }
452
+ .reveal { page: reveal; }
453
+ @page reveal { --pw-page-transition: wipe 0.5s left-to-right; --pw-page-duration: 5s; }
454
+ @page turned { --pw-page-rotate: 90; }
455
+ ```
456
+
457
+ A transition is a style (`split`, `blinds`, `box`, `wipe`, `dissolve`,
458
+ `glitter`, `replace`, `fly`, `push`, `cover`, `uncover` or `fade`), then
459
+ how long it takes, and as the style takes them where it travels from
460
+ (`left-to-right`, `bottom-to-top`, `right-to-left`, `top-to-bottom`,
461
+ `top-left-to-bottom-right`, or `none` for fly), `horizontal` or `vertical`,
462
+ and `inward` or `outward`. A value that can’t be read is a
463
+ `page-presentation` warning. An overlay, a slide shown again with more on
464
+ it, is just another page.
465
+
466
+ How the viewer opens the file is the edition’s, as `hyperref`’s
467
+ `pdfpagemode`, `pdfstartpage`, `pdfstartview` and `pdfdisplaydoctitle`
468
+ say it:
469
+
470
+ {project=slides}
471
+ ``` toml
472
+ [editions.deck]
473
+ media = "print"
474
+ page = "8in 6in"
475
+ page-mode = "full-screen" # or "bookmarks", "thumbnails", "layers", "attachments", "none"
476
+ start-page = 1 # counted from 1, whatever its folio
477
+ start-view = "fit-page" # or "fit-width", "top"
478
+
479
+ [editions.deck.viewer]
480
+ show-title = true # the title in the title bar, not the file's name
481
+ hide-toolbar = true # and hide-menubar, hide-window-ui, fit-window, center-window
482
+ after-full-screen = "bookmarks"
483
+ ```
484
+
485
+ {#pdf-javascript}
486
+ ## JavaScript
487
+
488
+ An edition can carry scripts of the project that a viewer which runs
489
+ JavaScript, such as Acrobat, runs when it opens the PDF, as LaTeX’s
490
+ `insdljs` adds them, each by its path from the project’s root, in order:
491
+
492
+ {.untested}
493
+ ``` toml
494
+ [editions.paperback]
495
+ javascript = ["scripts/open.js"]
496
+ ```
497
+
498
+ Each is document-level JavaScript named by its path; a file that isn’t
499
+ there is a `missing-script` error. Most viewers run none, so the book must
500
+ read the same without them. PDF/A and PDF/X allow no JavaScript, and an
501
+ edition that claims one of them can’t have any.