@taloswork/ose-shared 0.1.11 → 0.1.13

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 (159) hide show
  1. package/package.json +3 -3
  2. package/skills/document/SKILL.md +135 -219
  3. package/skills/document/art-directions/base.css +27 -2
  4. package/skills/document/art-directions/cinematic-depth.css +3 -1
  5. package/skills/document/art-directions/collage-paper.css +5 -1
  6. package/skills/document/art-directions/editorial-cut.css +5 -1
  7. package/skills/document/art-directions/geometric-pop.css +6 -0
  8. package/skills/document/art-directions/gradient-mesh.css +5 -1
  9. package/skills/document/art-directions/illustrated-doodle.css +5 -0
  10. package/skills/document/art-directions/luxury-ornament.css +4 -1
  11. package/skills/document/art-directions/maximalist-blocks.css +6 -0
  12. package/skills/document/art-directions/technical-grid.css +4 -0
  13. package/skills/document/assets/fonts/fonts.json +2 -2
  14. package/skills/document/assets/pdf-fonts/NotoSansSC-PDF-Bold.ttf +0 -0
  15. package/skills/document/assets/pdf-fonts/NotoSansSC-PDF-Regular.ttf +0 -0
  16. package/skills/document/assets/pdf-fonts/OFL.txt +93 -0
  17. package/skills/document/assets/pdf-fonts/README.md +35 -0
  18. package/skills/document/assets/tessdata/LICENSE-Apache-2.0.txt +202 -0
  19. package/skills/document/assets/tessdata/README.md +21 -0
  20. package/skills/document/assets/tessdata/chi_sim.traineddata.gz +0 -0
  21. package/skills/document/assets/tessdata/eng.traineddata.gz +0 -0
  22. package/skills/document/bin/deck-build.cjs +12563 -83
  23. package/skills/document/bin/deck-chart.cjs +771 -0
  24. package/skills/document/bin/deck-plan.cjs +12414 -0
  25. package/skills/document/bin/deck-qa.cjs +1075 -266
  26. package/skills/document/bin/deck-scenario.cjs +1363 -0
  27. package/skills/document/bin/deck-styles.cjs +1604 -0
  28. package/skills/document/bin/doc-convert.cjs +308 -292
  29. package/skills/document/bin/doc-fill.cjs +73264 -192
  30. package/skills/document/bin/doc-gen.cjs +2491 -312
  31. package/skills/document/bin/doc-run.cjs +162 -24
  32. package/skills/document/bin/doc-scan.cjs +13 -0
  33. package/skills/document/bin/doc-text.cjs +13 -0
  34. package/skills/document/bin/doc-validate.cjs +838 -68
  35. package/skills/document/bin/doc-xml.cjs +9 -5
  36. package/skills/document/bin/docx-annotate.cjs +95 -19
  37. package/skills/document/bin/docx-defaults.cjs +9907 -0
  38. package/skills/document/bin/fontkit.cjs +1 -0
  39. package/skills/document/bin/html2pptx.cjs +36622 -31394
  40. package/skills/document/bin/ocr-worker.cjs +1 -0
  41. package/skills/document/bin/ocr.cjs +131 -40
  42. package/skills/document/bin/pdf-form.cjs +682 -177
  43. package/skills/document/bin/pdf-images.cjs +13 -0
  44. package/skills/document/bin/pdf-ops.cjs +642 -199
  45. package/skills/document/bin/pdf-render.cjs +19 -3
  46. package/skills/document/bin/pdf-tables.cjs +13 -0
  47. package/skills/document/bin/pptx-clone.cjs +3 -3
  48. package/skills/document/bin/pptx-notes.cjs +10038 -0
  49. package/skills/document/bin/pptx-slide.cjs +3 -3
  50. package/skills/document/bin/pptx-tokenize.cjs +19 -4
  51. package/skills/document/bin/template-skin.cjs +10910 -0
  52. package/skills/document/bin/xlsx-query.cjs +192 -61
  53. package/skills/document/bin-reference.md +61 -33
  54. package/skills/document/catalog.json +33 -32
  55. package/skills/document/content-pipeline.md +179 -257
  56. package/skills/document/deck-design.md +378 -638
  57. package/skills/document/generated-visuals.md +99 -0
  58. package/skills/document/layouts/MAINTAINERS.md +33 -0
  59. package/skills/document/layouts/README.md +49 -36
  60. package/skills/document/layouts/big-stat.tpl +1 -1
  61. package/skills/document/layouts/capacity.json +1 -0
  62. package/skills/document/layouts/cards-3.tpl +1 -1
  63. package/skills/document/layouts/chart-full.tpl +1 -1
  64. package/skills/document/layouts/chart-kpi.tpl +1 -1
  65. package/skills/document/layouts/comparison.tpl +1 -1
  66. package/skills/document/layouts/data-table.tpl +1 -1
  67. package/skills/document/layouts/funnel.tpl +1 -1
  68. package/skills/document/layouts/gantt.tpl +1 -1
  69. package/skills/document/layouts/hub-flow.tpl +4 -0
  70. package/skills/document/layouts/icon-row.tpl +1 -1
  71. package/skills/document/layouts/image-grid.tpl +1 -1
  72. package/skills/document/layouts/matrix-2x2.tpl +1 -1
  73. package/skills/document/layouts/mock-qa.tpl +4 -0
  74. package/skills/document/layouts/profiles.json +2 -2
  75. package/skills/document/layouts/pyramid.tpl +1 -1
  76. package/skills/document/layouts/radar.tpl +1 -1
  77. package/skills/document/layouts/ring-progress.tpl +1 -1
  78. package/skills/document/layouts/slots.json +1 -1
  79. package/skills/document/layouts/steps-vertical.tpl +1 -1
  80. package/skills/document/layouts/steps.tpl +1 -1
  81. package/skills/document/layouts/three-kpi.tpl +1 -1
  82. package/skills/document/layouts/timeline.tpl +1 -1
  83. package/skills/document/layouts/toc-panel.tpl +2 -2
  84. package/skills/document/layouts/two-kpi.tpl +2 -2
  85. package/skills/document/layouts/versus.tpl +1 -1
  86. package/skills/document/motion/README.md +3 -2
  87. package/skills/document/office.md +3 -3
  88. package/skills/document/packs/README.md +1 -1
  89. package/skills/document/packs/board-brief/backdrop.html +2 -0
  90. package/skills/document/packs/board-brief/pack.css +2 -1
  91. package/skills/document/packs/mckinsey-photo/backdrop.html +2 -0
  92. package/skills/document/packs/mckinsey-photo/pack.css +2 -1
  93. package/skills/document/packs/press-room/backdrop.html +2 -0
  94. package/skills/document/packs/press-room/pack.css +2 -1
  95. package/skills/document/packs/prismatic-3d/backdrop.html +2 -0
  96. package/skills/document/packs/prismatic-3d/pack.css +4 -1
  97. package/skills/document/pdf.md +60 -43
  98. package/skills/document/rewrite.md +257 -309
  99. package/skills/document/scenarios.json +1307 -0
  100. package/skills/document/scenarios.schema.json +104 -0
  101. package/skills/document/styles/README.md +15 -25
  102. package/skills/document/styles/_backdrops/rimlight.html +3 -2
  103. package/skills/document/styles/_contract-defaults.css +31 -2
  104. package/skills/document/styles/_samples/_groups/biz-premium.webp +0 -0
  105. package/skills/document/styles/_samples/mckinsey.webp +0 -0
  106. package/skills/document/styles/anthropic/skin.css +6 -3
  107. package/skills/document/styles/apple/skin.css +4 -3
  108. package/skills/document/styles/bistro-warm/backdrop.html +2 -0
  109. package/skills/document/styles/bistro-warm/skin.css +4 -1
  110. package/skills/document/styles/black-gold/skin.css +6 -5
  111. package/skills/document/styles/bold-clash/backdrop.html +2 -0
  112. package/skills/document/styles/bold-clash/skin.css +2 -1
  113. package/skills/document/styles/branding/skin.css +4 -4
  114. package/skills/document/styles/campus-teal/backdrop.html +2 -0
  115. package/skills/document/styles/campus-teal/skin.css +2 -1
  116. package/skills/document/styles/cinereel/skin.css +7 -3
  117. package/skills/document/styles/clinic-care/backdrop.html +2 -0
  118. package/skills/document/styles/clinic-care/skin.css +2 -1
  119. package/skills/document/styles/cool/skin.css +6 -5
  120. package/skills/document/styles/dark-glass/backdrop.html +2 -0
  121. package/skills/document/styles/dark-glass/skin.css +2 -1
  122. package/skills/document/styles/gov-brief/backdrop.html +2 -0
  123. package/skills/document/styles/gov-brief/skin.css +2 -1
  124. package/skills/document/styles/grid-tech/backdrop.html +2 -0
  125. package/skills/document/styles/grid-tech/skin.css +2 -1
  126. package/skills/document/styles/hand-drawn/skin.css +3 -3
  127. package/skills/document/styles/ivory-gold/skin.css +7 -6
  128. package/skills/document/styles/legal-slate/backdrop.html +2 -0
  129. package/skills/document/styles/legal-slate/skin.css +2 -1
  130. package/skills/document/styles/magazine-ink/skin.css +4 -3
  131. package/skills/document/styles/mckinsey/backdrop.html +7 -5
  132. package/skills/document/styles/mckinsey/skin.css +2 -1
  133. package/skills/document/styles/memphis/backdrop.html +2 -0
  134. package/skills/document/styles/memphis/skin.css +2 -1
  135. package/skills/document/styles/mono/skin.css +6 -2
  136. package/skills/document/styles/neon-cyber/backdrop.html +2 -0
  137. package/skills/document/styles/neon-cyber/skin.css +2 -1
  138. package/skills/document/styles/olive-gold/skin.css +7 -6
  139. package/skills/document/styles/organic-earth/backdrop.html +2 -0
  140. package/skills/document/styles/organic-earth/skin.css +2 -1
  141. package/skills/document/styles/pastel-saas/backdrop.html +2 -0
  142. package/skills/document/styles/pastel-saas/skin.css +2 -1
  143. package/skills/document/styles/portfolio-noir/backdrop.html +2 -0
  144. package/skills/document/styles/portfolio-noir/skin.css +2 -1
  145. package/skills/document/styles/retro-press/backdrop.html +2 -0
  146. package/skills/document/styles/retro-press/skin.css +2 -1
  147. package/skills/document/styles/sport-arena/backdrop.html +2 -0
  148. package/skills/document/styles/sport-arena/skin.css +4 -1
  149. package/skills/document/styles/swiss-grid/skin.css +10 -5
  150. package/skills/document/styles/wedding-blush/backdrop.html +2 -0
  151. package/skills/document/styles/wedding-blush/skin.css +4 -1
  152. package/skills/document/theme-system.md +85 -77
  153. package/skills/document/themes/README.md +7 -5
  154. package/skills/document/vision.md +8 -5
  155. package/skills/document/xlsx.md +15 -25
  156. package/skills/grill-me/SKILL.md +6 -0
  157. package/skills/grill-me/agents/openai.yaml +5 -0
  158. package/skills/grilling/SKILL.md +28 -0
  159. package/skills/grilling/agents/openai.yaml +3 -0
@@ -2,7 +2,7 @@
2
2
  手改会在下次生成时丢失:要改就改 family.json。 */
3
3
  :root{
4
4
  --space-scale:0.96; --type-scale:0.94;
5
- --accent:#075F8B; --c1:#075F8B; --c2:#634E8E; --c3:#913C61; --c4:#8E4430; --chart-1:#075F8B;
5
+ --accent:#075F8B; --c1:#075F8B; --c2:#634E8E; --c3:#913C61; --c4:#8E4430; --chart-1:#075F8B; --series-1:#075F8B; --series-2:#8570B3; --series-3:#76234A; --series-4:#9E533E;
6
6
  --title:#202930; --body:#4B5156; --muted:#767D82; --foot:#767D82;
7
7
  --hair:#C8D3DC; --card-radius:4px;
8
8
  --font-head:'Archivo','Noto Sans SC',sans-serif;
@@ -14,6 +14,7 @@
14
14
  .deck-header,.deck-footer,.deck-pageno{color:var(--muted)}
15
15
  .rule,.rule-foot{background:var(--hair)}
16
16
  .eyebrow{color:var(--accent);letter-spacing:.22em;font-weight:700}
17
+ .slide:is([data-layout="cover-image"],[data-layout="image-full"],[data-layout="section-fullbleed"]) .eyebrow{color:#B5CFDC}
17
18
  .accent-bar{background:var(--accent)}
18
19
  .deck-title,.cover-title,.section-title,.ending-title{color:var(--title);font-family:var(--font-head);font-weight:700}
19
20
  .cover-sub,.ending-sub,.section-desc{color:var(--muted)}
@@ -1,6 +1,8 @@
1
1
  <!-- generated by scripts/ppt-tpl/gen-skin.mjs — signature: crop-marks -->
2
2
  <div style="position:absolute;inset:0;background:#FAFDFF"></div>
3
+ <div class="sig-layer" data-signature="crop-marks" style="position:absolute;inset:0;pointer-events:none">
3
4
  <div style="position:absolute;left:44px;top:44px;border-left:1px solid var(--hair);border-top:1px solid var(--hair);width:26px;height:26px;pointer-events:none"></div>
4
5
  <div style="position:absolute;right:44px;top:44px;border-right:1px solid var(--hair);border-top:1px solid var(--hair);width:26px;height:26px;pointer-events:none"></div>
5
6
  <div style="position:absolute;left:44px;bottom:44px;border-left:1px solid var(--hair);border-bottom:1px solid var(--hair);width:26px;height:26px;pointer-events:none"></div>
6
7
  <div style="position:absolute;right:44px;bottom:44px;border-right:1px solid var(--hair);border-bottom:1px solid var(--hair);width:26px;height:26px;pointer-events:none"></div>
8
+ </div>
@@ -2,7 +2,7 @@
2
2
  手改会在下次生成时丢失:要改就改 family.json。 */
3
3
  :root{
4
4
  --space-scale:0.88; --type-scale:0.95;
5
- --accent:#1074A7; --c1:#1074A7; --c2:#645DD4; --c3:#C22B93; --c4:#D02841; --chart-1:#1074A7;
5
+ --accent:#1074A7; --c1:#1074A7; --c2:#645DD4; --c3:#C22B93; --c4:#D02841; --chart-1:#1074A7; --series-1:#1074A7; --series-2:#7874ED; --series-3:#C73197; --series-4:#B20E30;
6
6
  --title:#003044; --body:#375366; --muted:#687987; --foot:#687987;
7
7
  --hair:#CFDCE6; --card-radius:4px;
8
8
  --font-head:'IBM Plex Sans','Noto Sans SC',sans-serif;
@@ -14,6 +14,7 @@
14
14
  .deck-header,.deck-footer,.deck-pageno{color:var(--muted)}
15
15
  .rule,.rule-foot{background:var(--hair)}
16
16
  .eyebrow{color:var(--accent);letter-spacing:.22em;font-weight:700}
17
+ .slide:is([data-layout="cover-image"],[data-layout="image-full"],[data-layout="section-fullbleed"]) .eyebrow{color:#B7D5E5}
17
18
  .accent-bar{background:var(--accent)}
18
19
  .deck-title,.cover-title,.section-title,.ending-title{color:var(--title);font-family:var(--font-head);font-weight:700}
19
20
  .cover-sub,.ending-sub,.section-desc{color:var(--muted)}
@@ -1,4 +1,6 @@
1
1
  <!-- generated by scripts/ppt-tpl/gen-skin.mjs — signature: header-band -->
2
2
  <div style="position:absolute;inset:0;background:#FDF5F0"></div>
3
+ <div class="sig-layer" data-signature="header-band" style="position:absolute;inset:0;pointer-events:none">
3
4
  <div style="position:absolute;left:0;right:0;top:0;height:5px;background:var(--accent);opacity:.92;pointer-events:none"></div>
4
5
  <div style="position:absolute;left:0;top:0;width:60px;height:16px;background:var(--accent);pointer-events:none"></div>
6
+ </div>
@@ -2,7 +2,7 @@
2
2
  手改会在下次生成时丢失:要改就改 family.json。 */
3
3
  :root{
4
4
  --space-scale:1; --type-scale:1;
5
- --accent:#C12E4C; --c1:#C12E4C; --c2:#896103; --c3:#0B7927; --c4:#117379; --chart-1:#C12E4C;
5
+ --accent:#C12E4C; --c1:#C12E4C; --c2:#896103; --c3:#0B7927; --c4:#117379; --chart-1:#C12E4C; --series-1:#C12E4C; --series-2:#845F0F; --series-3:#2C8E3C; --series-4:#116A70;
6
6
  --title:#26201D; --body:#564F4B; --muted:#827B76; --foot:#827B76;
7
7
  --hair:#CBBFB7; --card-radius:4px;
8
8
  --font-head:'Bodoni Moda','Songti SC',sans-serif;
@@ -14,6 +14,7 @@
14
14
  .deck-header,.deck-footer,.deck-pageno{color:var(--muted)}
15
15
  .rule,.rule-foot{background:var(--hair)}
16
16
  .eyebrow{color:var(--accent);letter-spacing:.22em;font-weight:700}
17
+ .slide:is([data-layout="cover-image"],[data-layout="image-full"],[data-layout="section-fullbleed"]) .eyebrow{color:#ECC0C9}
17
18
  .accent-bar{background:var(--accent)}
18
19
  .deck-title,.cover-title,.section-title,.ending-title{color:var(--title);font-family:var(--font-head);font-weight:700;--talos-bake:1}
19
20
  .cover-sub,.ending-sub,.section-desc{color:var(--muted)}
@@ -1,4 +1,6 @@
1
1
  <!-- generated by scripts/ppt-tpl/gen-skin.mjs — signature: diagonal-band -->
2
2
  <div style="position:absolute;inset:0;background:#270E28"></div>
3
+ <div class="sig-layer" data-signature="diagonal-band" style="position:absolute;inset:0;pointer-events:none">
3
4
  <div style="position:absolute;right:-60px;top:-40px;width:260px;height:820px;background:var(--accent);opacity:.14;transform:rotate(18deg);pointer-events:none"></div>
4
5
  <div style="position:absolute;right:96px;top:-40px;width:2px;height:820px;background:var(--accent);opacity:.5;transform:rotate(18deg);pointer-events:none"></div>
6
+ </div>
@@ -2,7 +2,7 @@
2
2
  手改会在下次生成时丢失:要改就改 family.json。 */
3
3
  :root{
4
4
  --space-scale:0.98; --type-scale:1.06;
5
- --accent:#E168CF; --c1:#E168CF; --c2:#8E88FA; --c3:#099DEE; --c4:#1FA3C4; --chart-1:#E168CF;
5
+ --accent:#E168CF; --c1:#E168CF; --c2:#8E88FA; --c3:#099DEE; --c4:#1FA3C4; --chart-1:#E168CF; --series-1:#E168CF; --series-2:#8E88FA; --series-3:#0C6AA1; --series-4:#29A9CA;
6
6
  --title:#F8F1FA; --body:#C8BDCC; --muted:#938898; --foot:#938898;
7
7
  --hair:#523A52; --card-radius:4px;
8
8
  --font-head:'Big Shoulders Display','Noto Sans SC',sans-serif;
@@ -14,6 +14,7 @@
14
14
  .deck-header,.deck-footer,.deck-pageno{color:var(--muted)}
15
15
  .rule,.rule-foot{background:var(--hair)}
16
16
  .eyebrow{color:var(--accent);letter-spacing:.22em;font-weight:700}
17
+ .slide:is([data-layout="cover-image"],[data-layout="image-full"],[data-layout="section-fullbleed"]) .eyebrow{color:#F6D2F1}
17
18
  .accent-bar{background:var(--accent)}
18
19
  .deck-title,.cover-title,.section-title,.ending-title{color:var(--title);font-family:var(--font-head);font-weight:700;--talos-bake:1}
19
20
  .cover-sub,.ending-sub,.section-desc{color:var(--muted)}
@@ -26,3 +27,5 @@
26
27
  .kpi-num,.stat-num{color:var(--title);font-family:var(--font-head);--talos-bake:1}
27
28
  .kpi-label,.stat-unit{color:var(--muted)} .stat-lead{color:var(--title)} .stat-note{color:var(--body)}
28
29
  .media-frame,.media-cutout{border-radius:0;clip-path:polygon(12% 0,100% 0,88% 100%,0 82%);border:1px solid var(--accent)}
30
+ .slide[data-layout]:not([data-layout^="cover"],[data-layout^="section"],[data-layout^="title"],[data-layout^="ending"],[data-layout="hero"],[data-layout="transition"]) .slide-backdrop:has(> .theme-art-layer) > .sig-layer > *{translate:230px 0}
31
+ .slide[data-layout]:not([data-layout^="cover"],[data-layout^="section"],[data-layout^="title"],[data-layout^="ending"],[data-layout="hero"],[data-layout="transition"]) .slide-backdrop:has(> .theme-art-layer) > .sig-layer{-webkit-mask-image:var(--decor-safe-mask);mask-image:var(--decor-safe-mask)}
@@ -1,54 +1,71 @@
1
1
  # PDF (L3)
2
2
 
3
- Default to the **text layer**; render pages only when the content is visual.
4
-
5
- ## Steps
6
-
7
- 1. `bin/doc-scan file.pdf` — inspect per-page signals.
8
- 2. For text-dominated pages: `bin/doc-text file.pdf` and read the result.
9
- 3. For a page with `scanned:true`, high `imageCoverage`, or a `mathHint`/
10
- `tableHint` you must honor: `bin/pdf-render file.pdf <page>` then look at the
11
- PNG (see vision.md). Only do this when you can see images.
12
- 4. **Formulas:** no extractor emits LaTeX. `pdf-render` the page and transcribe
13
- to LaTeX from the image (small/dense formulas: render at higher fidelity — a
14
- `mathHint` page is worth a full-page render before transcribing). If the model
15
- can't see images, say so — a text-only model cannot recover formulas.
16
- Rebuilding into a doc/deck: emit the LaTeX as text, or render the formula to
17
- an image and place that (pptxgenjs has no native math typesetting).
18
- 5. **Tables:** the text layer often mangles columns. Prefer rendering the page,
19
- or (for data you must compute on) ask the user to provide the table as xlsx.
3
+ Default to the **text layer** (the `<file>.txt` sidecar you already read, or `doc-text`);
4
+ render pages only when the content is visual.
20
5
 
21
- ## Boundaries / failure
6
+ ## Read: text first, escalate on evidence
7
+
8
+ 1. `bin/doc-scan.cjs file.pdf` → cheap per-page signals (`textChars`, `imageCoverage`,
9
+ `mathHint`, `tableHint`, `scanned`).
10
+ 2. Read intent: summarize/translate → text; formulas/tables/figures/layout → visual;
11
+ unsure → start with text.
12
+ 3. Per page: `scanned` OR high `imageCoverage` OR (visual intent AND a math/table hint)
13
+ → `bin/pdf-render.cjs file.pdf <page>` and look (vision.md); else
14
+ `bin/doc-text.cjs file.pdf`.
15
+ 4. **Self-correct:** text garbled or missing where the answer should be (a formula's
16
+ symbols shredded, a table collapsed into one line, a page with almost no characters)
17
+ → render THAT page and look.
18
+ 5. **Formulas:** no extractor emits LaTeX. Render the page (keep scale 2) and transcribe
19
+ to LaTeX from the image. Rebuilding into a doc/deck: emit the LaTeX as text, or render
20
+ the formula to an image and place that.
21
+ 6. **Tables:** `bin/pdf-tables.cjs file.pdf [page]` recovers text-layer tables as rows.
22
+ Missing, garbled, ruled or scanned → render the page and read it visually; for data you
23
+ must compute on, an .xlsx from the user is exact.
24
+ 7. **Figures as files** (e.g. rebuilding a deck): `bin/pdf-images.cjs file.pdf [pages]`
25
+ extracts embedded images at native resolution; vector pages yield nothing → render.
22
26
 
23
- - Scanned PDF + text-only model → OCR (slow) or explicitly report that a
24
- multimodal model is needed. Never return an empty summary silently.
25
- - Very large PDFs: render only the pages you actually need — do not bulk-render.
26
- - Encrypted/corrupt PDF → `doc-scan`/`doc-text` exit non-zero; report the error.
27
+ ## Boundaries / failure
27
28
 
28
- ## Form filling (verify visually — mandatory when you can see images)
29
+ - **Vision unavailable** (text-only model): text, or OCR a rendered page (vision.md),
30
+ and state the limitation plainly — never return an empty summary silently. A
31
+ text-only model cannot recover formulas.
32
+ - Very large PDFs: render only the pages you need — never bulk-render.
33
+ - Corrupt PDF → `doc-scan`/`doc-text` exit non-zero; report the error. A
34
+ password-protected PDF exits 1 (`PDF is password-protected … decrypt first`) from
35
+ every reader and editor: ask for the password and `pdf-ops decrypt` it.
29
36
 
30
- After `bin/pdf-form.cjs fill` (or coordinate `pdf-ops stamp` on a flat form):
37
+ ## Fonts in generated PDFs
31
38
 
32
- 1. `bin/pdf-render.cjs filled.pdf <page>` for each filled page.
33
- 2. LOOK at the PNG: is every value in its box, nothing clipped/overlapping?
34
- 3. Misplaced → adjust coordinates/field values and refill; re-render to confirm.
35
- 4. Text-only model: state that the fill is unverified visually — don't claim it
36
- is correct.
39
+ - App printing preserves caller-loaded embedded fonts before CJK fallback. A
40
+ system family name alone does not guarantee portable typography.
41
+ - Standalone printing rejects missing/invalid font manifests, missing/empty
42
+ referenced faces and failed web-font loads. `TALOS_CJK_FONTS=system` explicitly
43
+ relies on host fonts; it does not repair missing assets.
44
+ - Page labels: centered 8pt Helvetica/Noto Sans SC; reserve ≥24pt per active edge.
45
+ `{title}`, `{page}`, `{pages}` resolve after pagination. Overflow/missing glyphs fail.
46
+ - PDF reports label `validationScope:"structure-only"` and
47
+ `textStatsSource:"input-spec"`. Counts describe requested text, not visible
48
+ glyphs. Inspect previews for font substitution, missing text and clipping.
37
49
 
38
- ## Encrypt / decrypt
50
+ ## Forms and flat-PDF filling
39
51
 
40
- - `bin/pdf-ops.cjs encrypt <in> <out> <user-pw> [owner-pw]` — AES-256.
41
- - `bin/pdf-ops.cjs decrypt <in> <password> <out>` — wrong password exits
42
- non-zero; never guess passwords.
43
- - Extract embedded images at native resolution with `bin/pdf-images.cjs <file>
44
- [pages]` — one PNG per placed image plus a JSON manifest (page/bbox/size).
45
- Re-encoded to PNG (pixel-exact, not byte-exact) at the image's own resolution,
46
- so it beats a full-page `pdf-render` when you need the figures as separate
47
- assets (e.g. reconstructing a deck). Vector/text-only pages yield nothing —
48
- `pdf-render` and look instead.
52
+ 1. `bin/pdf-form.cjs list in.pdf` → field names and types; `fill in.pdf values.json
53
+ out.pdf [--flatten]` with `{"<field>": "text", "<checkbox>": true}` (unknown names
54
+ come back in `skipped`).
55
+ 2. A flat PDF (no fields) → `bin/pdf-ops.cjs stamp in.pdf stamps.json out.pdf` with
56
+ `[{"page": 1, "x": 72, "y": 700, "text": "…", "size"?: 11}]` (points, origin bottom-left).
57
+ 3. **Chinese works:** fill, `stamp` and `watermark` draw CJK text in the bundled Noto
58
+ Sans SC. A character it lacks (emoji, rare extension hanzi) exits 1 naming it —
59
+ replace it; never drop text silently.
60
+ 4. **Verify visually (mandatory when you can see images):** `bin/pdf-form.cjs overlay
61
+ filled.pdf boxed.pdf` outlines every field in red; `pdf-render` each filled page and
62
+ LOOK — every value inside its box, nothing clipped or overlapping. Misplaced → adjust
63
+ and refill. A text-only model states the fill is visually unverified.
49
64
 
50
- ## Form-fill validation overlay
65
+ ## Page ops and passwords
51
66
 
52
- After filling: `bin/pdf-form.cjs overlay filled.pdf boxed.pdf` stamps a red
53
- outline around every field, then `pdf-render` the page and LOOK — every value
54
- inside its box, nothing clipped.
67
+ `bin/pdf-ops.cjs merge | split | rotate | watermark` keep every page verbatim
68
+ (bin-reference.md "Fill and edit"). `encrypt <in> <out> <user-pw> [owner-pw]` is
69
+ AES-256 — run `doc-validate` and render BEFORE encrypting (an encrypted PDF fails
70
+ `doc-validate`). `decrypt <in> <password> <out>` exits non-zero on a wrong password —
71
+ never guess passwords; `""` decrypts an owner-password-only PDF.