postext-pdf 1.25.1 → 1.25.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  `postext-pdf` turns the document that `postext` lays out into a real PDF, in the browser or in Node. It does not re-measure anything: it consumes the same `VDTDocument` the canvas and HTML renderers use and translates its coordinates into PDF points, so the three outputs agree on every line break, column height and resource placement. The PDF embeds the actual font files, carries outline bookmarks and is tagged for accessibility (PDF/UA oriented).
6
6
 
7
- **Website:** [postext.dev](https://postext.dev/) · **Docs:** [PDF output](https://postext.dev/en/docs/configuration#generating-pdfs)
7
+ **Website:** [postext.dev](https://postext.dev/) · **Docs:** [PDF output](https://postext.dev/en/docs/configuration-programmatic-usage#generating-pdfs)
8
8
 
9
9
  ## Install
10
10
 
@@ -1,8 +1,8 @@
1
1
  import fs from 'node:fs';
2
2
  import { describe, expect, it } from 'vitest';
3
- // The option lists the configuration reference (English and Spanish) and
4
- // the package README give for `renderToPdf` name every field of
5
- // `RenderToPdfOptions`, and nothing else.
3
+ // The option lists the configuration reference (its Programmatic usage page,
4
+ // English and Spanish) and the package README give for `renderToPdf` name
5
+ // every field of `RenderToPdfOptions`, and nothing else.
6
6
  const read = (path) => fs.readFileSync(new URL(path, import.meta.url), 'utf8');
7
7
  const source = read('../pdf-backend/index.ts');
8
8
  const body = /export interface RenderToPdfOptions \{([\s\S]*?)\n\}/.exec(source)?.[1] ?? '';
@@ -13,7 +13,7 @@ describe('the documented renderToPdf options', () => {
13
13
  expect(FIELDS).toContain('fontProvider');
14
14
  expect(FIELDS.length).toBeGreaterThan(5);
15
15
  });
16
- for (const doc of ['configuration-en.mdx', 'configuration-es.mdx']) {
16
+ for (const doc of ['configuration-programmatic-usage-en.mdx', 'configuration-programmatic-usage-es.mdx']) {
17
17
  it(`are all listed in the RenderToPdfOptions summary of ${doc}`, () => {
18
18
  const summary = /\*\*`RenderToPdfOptions`\*\* — `\{([^}]*)\}`/.exec(read(`../../../../docs/${doc}`))?.[1] ?? '';
19
19
  const listed = summary.split(',').map((f) => f.trim().replace(/\?$/, '')).filter(Boolean).sort();
@@ -1 +1 @@
1
- {"version":3,"file":"renderOptionsDocs.test.js","sourceRoot":"","sources":["../../src/__tests__/renderOptionsDocs.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,yEAAyE;AACzE,gEAAgE;AAChE,0CAA0C;AAE1C,MAAM,IAAI,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;AAE/F,MAAM,MAAM,GAAG,IAAI,CAAC,yBAAyB,CAAC,CAAC;AAC/C,MAAM,IAAI,GAAG,sDAAsD,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5F,mEAAmE;AACnE,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAElH,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAClD,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAC5B,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACzC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,KAAK,MAAM,G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AI,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAChH,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;YACjG,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,IAAI,IAAI,GAAG,8DAA8D,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACnH,2DAA2D;QAC3D,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;QACvE,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACvE,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postext-pdf",
3
- "version": "1.25.1",
3
+ "version": "1.25.3",
4
4
  "description": "Browser-native PDF renderer for Postext documents. Consumes the same VDT as the canvas/HTML backends and produces a physical PDF with faithful glyph positioning, justification, crop marks, and baseline grid.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "./package.json": "./package.json"
41
41
  },
42
42
  "peerDependencies": {
43
- "postext": "^1.25.1"
43
+ "postext": "^1.25.3"
44
44
  },
45
45
  "dependencies": {
46
46
  "@pdf-lib/fontkit": "^1.1.1",
@@ -54,7 +54,7 @@
54
54
  "@types/node": "^26.5.0",
55
55
  "eslint": "^9.39.4",
56
56
  "harfbuzzjs": "1.6.2",
57
- "postext": "1.25.1",
57
+ "postext": "1.25.3",
58
58
  "typescript": "^6.0.3",
59
59
  "typescript-eslint": "^8.70.0",
60
60
  "vitest": "^5.0.0"