diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2d746c1..b3ea4a8 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1115,6 +1115,7 @@ jobs: python tools/build_browser_starter.py python tools/check_online_starter.py browser python tools/check_browser_starter.py --dist docs/assets/browser-demo --out output/browser-starter-ui --browser chrome + python tools/check_starter_invoices.py --kind browser --dist docs/assets/browser-demo --archive docs/assets/browser-starter/project.zip --out output/browser-starter-ui/invoices --reference docs/assets/browser-starter/invoice-verification.json - uses: actions/upload-artifact@v4 if: always() with: @@ -1130,6 +1131,7 @@ jobs: python tools/build_react_starter.py python tools/check_online_starter.py react python tools/check_react_starter.py --dist docs/assets/react-demo --out output/react-starter-ui --browser chrome + python tools/check_starter_invoices.py --kind react --dist docs/assets/react-demo --archive docs/assets/react-starter/project.zip --out output/react-starter-ui/invoices --reference docs/assets/react-starter/invoice-verification.json - uses: actions/upload-artifact@v4 if: always() with: @@ -1145,6 +1147,7 @@ jobs: python tools/build_vue_starter.py python tools/check_online_starter.py vue python tools/check_vue_starter.py --dist docs/assets/vue-demo --out output/vue-starter-ui --browser chrome + python tools/check_starter_invoices.py --kind vue --dist docs/assets/vue-demo --archive docs/assets/vue-starter/project.zip --out output/vue-starter-ui/invoices --reference docs/assets/vue-starter/invoice-verification.json - uses: actions/upload-artifact@v4 if: always() with: diff --git a/docs/assets/browser-starter/invoice-verification.json b/docs/assets/browser-starter/invoice-verification.json new file mode 100644 index 0000000..830a2e1 --- /dev/null +++ b/docs/assets/browser-starter/invoice-verification.json @@ -0,0 +1,339 @@ +{ + "ok": true, + "at": "2026-10-31T08:32:08.429621+00:00", + "kind": "browser", + "browser": "chrome", + "browserVersion": "156.0.8078.47", + "cases": [ + { + "name": "short", + "pages": 1, + "items": 3, + "pdfSha256": "85c991aff1d8c5f846e7a7ec218e26c2a9c818f2436aba218f7eb665d6120db0", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 979, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + } + ], + "previewSha256": [ + "06a968aee07f77fa11a8d8f417953fb62eeecee2eb76c43b246ae1a5aff75894" + ] + }, + { + "name": "long", + "pages": 3, + "items": 24, + "pdfSha256": "9ab155fb46cc991e71de731c710c1b1236247a0fe129aafe719b6e807a639af7", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 914, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 963, + "textBox": [ + 45.80999755859375, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 638, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + } + ], + "previewSha256": [ + "2163f992bd3945fd611c8b60353ea0504e9e3ba9ec36add1121481d9a83debdd", + "f239a2115cdc284232941e87768400a79eb40842b5622995428eaf0211d5eb74", + "835f8f28eac1b957b92b5c4818fe67f3a1ed0762bc8046d930ea5af76511b589" + ], + "repeatPdfBytesMatch": true + }, + { + "name": "empty", + "pages": 1, + "items": 0, + "pdfSha256": "fda9fadbcf60e4ac4ddf549d5ebe71e1f9b3fa65098166dd14e63950c7b1402f", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 723, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + } + ], + "previewSha256": [ + "63090086db7abaf17e990f6b946d2466be2da18d48f8ad2c20b4978a0f0e9a7f" + ] + }, + { + "name": "wrapped", + "pages": 3, + "items": 12, + "pdfSha256": "3964a30443701c291cbba814653b54b7072c0c1ae21df97b7a58bb95653345fe", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 1559, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 2040, + "textBox": [ + 45.705997467041016, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 644, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + } + ], + "previewSha256": [ + "4d76aade737f3e3088c6d32fd20dbd18cf6a181da7e80897570a3cf793ff0fe3", + "41955e0e7565ca9f2b49d6f05d16c95557d83f7692e3c778b6b8f77e3cd08f72", + "ac0c8b36d140f481401245bafb06ec5f4df98a756483c0ff32e4cf27ac5eed0b" + ] + }, + { + "name": "boundary-4", + "pages": 2, + "items": 4, + "pdfSha256": "9574eb156a927b8e81a086ce6ebba9e09294368086410cdb2ea22e6c0c69a189", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 707, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.428955078125, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "008eb10f532151cb311dc2fb139bb22da33c69cb69e208daa9fdb26209210d9f", + "60bf7ff29dfe9eb6564e2eb5d266339fb068153e5fd7b4da54d8aca769d6119e" + ] + }, + { + "name": "boundary-5", + "pages": 2, + "items": 5, + "pdfSha256": "902d130eceb3a3102b90bee459ff3f23f4a3e45d0c288e6c73fc2d206888e1bd", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 776, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.428955078125, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "5eeba8c80fd061365bf894765b2d6455feba877bc332e426a34172270e4e0ea5", + "fa227c93cda219eff4f2df7f4ed765c7576d309a1ae0cc820b92c313fe3aa1d3" + ] + }, + { + "name": "boundary-16", + "pages": 3, + "items": 16, + "pdfSha256": "63252296fb4efc1c15207ca570425c8da496a95929574e5460d881a77cf1e4a5", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 914, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 687, + "textBox": [ + 45.80999755859375, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5040893554688, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "2163f992bd3945fd611c8b60353ea0504e9e3ba9ec36add1121481d9a83debdd", + "5ec48a902be0577baee96b518108ce86dc4521e1ea195e423c743e945236ebc0", + "0c3e44c85d619aec5184628b392bb128656525ae2b0ab351d92e216b8edc256b" + ] + }, + { + "name": "boundary-17", + "pages": 3, + "items": 17, + "pdfSha256": "89639fcb94d3c98d70546df833e8ff6bb6bbefa35fbbf250632535c6c1446e2b", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 914, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 756, + "textBox": [ + 45.80999755859375, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5040893554688, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "2163f992bd3945fd611c8b60353ea0504e9e3ba9ec36add1121481d9a83debdd", + "c2f4069f46d8c9ad8f37549ce27358ae88223d530e5b99da4779b321c700e9c9", + "68207462f4a24363b264ad22bee0cdef9b1c0507ed9fbf809c82dd5852ad29ce" + ] + } + ], + "sourceSha256": { + "html": "15829aaf6c698acc36c10111d657c84d346109e5196abc3381616de7c54ffe66", + "css": "3697ea678ffdb56cd438d7ea9fcedd83b7d0d48c40c3c4755ef6091fa7a12cb8" + }, + "errors": [], + "nonGetRequests": 0, + "scope": "These synthetic invoice records, actual PDF downloads and displayed previews. No universal layout, accessibility, conformance or adoption claim.", + "source_commit": "400f362841ed7482c5afc05efc3a2446888f5285", + "package_version": "0.8.4", + "engine_version": "2.5.40", + "zip_sha256": "71f6d4817e0cc368e960b17eb58f4ae5355e186e5f081d05e1b5260d7f7864bf" +} diff --git a/docs/assets/browser-starter/project.zip b/docs/assets/browser-starter/project.zip index be34a75..1496899 100644 Binary files a/docs/assets/browser-starter/project.zip and b/docs/assets/browser-starter/project.zip differ diff --git a/docs/assets/browser-starter/source.json b/docs/assets/browser-starter/source.json index a3fe33e..6e01173 100644 --- a/docs/assets/browser-starter/source.json +++ b/docs/assets/browser-starter/source.json @@ -1,27 +1,28 @@ { "source_repository": "https://github.com/fullbleed-engine/fullbleed-node", - "source_commit": "6e266eadca484b826c67d0bf75d7a042c3f159a3", + "source_commit": "400f362841ed7482c5afc05efc3a2446888f5285", "source_directory": "examples/browser", "package_version": "0.8.4", "engine_version": "2.5.40", "package_integrity": "sha512-/8UA7by0SyGdqj9OH0g3J5J4TldQJRT9cMUfaX3DMXvkOZ7DeSzOzvE5v5lN3CBY4prcllc/u3ZSEK+ZEbrTaw==", - "zip_bytes": 24392, - "zip_sha256": "4f6ba24fee6eeaad87aaa844868538d494bb35c6e586a90b2cd5aca13b634b95", + "zip_bytes": 24702, + "zip_sha256": "71f6d4817e0cc368e960b17eb58f4ae5355e186e5f081d05e1b5260d7f7864bf", "files": { "fullbleed-browser-starter/.gitignore": "c023fec2bf12476cb47709e859f1fbb785aeb1e03281e52141e0bee1ee7dad72", "fullbleed-browser-starter/LICENSE": "36a2115938f6e68cf0d87eccff7a6a3e57c17017e909cbd640d51aff1fa0c5a9", - "fullbleed-browser-starter/README.md": "8f7bf7f6b704c144ebdd4fe07c0d54c2ddd611151650cd4bc4e2c8bc32771786", + "fullbleed-browser-starter/README.md": "19b6e4cc69ed30978299bab9665e52121b2b7820f04f7bb26d74b2b845621998", "fullbleed-browser-starter/index.html": "8cbae46ebceaa5c595db4056e96563eda4da5bf9b0a53c66830ba67e41f7d959", "fullbleed-browser-starter/package-lock.json": "72c7269c9a4e5410bbd09cdc16ed4581bbb2d9aaff861ea43d26563a68257ae3", "fullbleed-browser-starter/package.json": "ae37d2fa1f6c4451bc27e3a0bbdc05513c98ca41d9b4bf40bc02679fa1c15e56", "fullbleed-browser-starter/public/favicon.svg": "14e54700b07ee8762556b4fdeb1b406bfc79492bc1d6958e3f97dbd83c2cd0d0", - "fullbleed-browser-starter/src/invoice.css": "0b310ce0f2964fd6b9b68e4afafa9307b4ff8c6b2f1fc753367dc755620ce427", - "fullbleed-browser-starter/src/invoice.html": "1f065ad6694021649e61b3f666cba6dc01aacdcbd8e80e97425b383e60d7d2fe", + "fullbleed-browser-starter/src/invoice.css": "3697ea678ffdb56cd438d7ea9fcedd83b7d0d48c40c3c4755ef6091fa7a12cb8", + "fullbleed-browser-starter/src/invoice.html": "15829aaf6c698acc36c10111d657c84d346109e5196abc3381616de7c54ffe66", "fullbleed-browser-starter/src/main.js": "3ffcbe09c7117e635c21c39ad9be1aa3e7af16be7fc325683a7baaecae04d275", "fullbleed-browser-starter/src/report.css": "519591ae75c239ec602324f008dd99108ebeae0b9306df7215fa5f0442905473", "fullbleed-browser-starter/src/report.html": "46b0e975d43914c8b4492218feae09ea0ad684091a9f9ee3b18f66a87202e521", "fullbleed-browser-starter/src/style.css": "131426c760df6f64f5890d03f2b3301bf2003f63008b7f90aea311c400db6f17", "fullbleed-browser-starter/vite.config.js": "ec725922705a3c5ba2df191a564c54c0cac6e8997ecd3d00b8a42c647bec8e74" }, - "local_ui_evidence": "https://docs.fullbleed.dev/assets/browser-starters-084-verification.json" + "local_ui_evidence": "https://docs.fullbleed.dev/assets/browser-starter/invoice-verification.json", + "verification_workflow": "https://github.com/fullbleed-engine/fullbleed-node/actions/workflows/browser-starter.yml" } diff --git a/docs/assets/react-starter/baseline/invoice-1.png b/docs/assets/react-starter/baseline/invoice-1.png index 5918b8c..bfba0d1 100644 Binary files a/docs/assets/react-starter/baseline/invoice-1.png and b/docs/assets/react-starter/baseline/invoice-1.png differ diff --git a/docs/assets/react-starter/baseline/invoice.pdf b/docs/assets/react-starter/baseline/invoice.pdf index caf8fe6..f5943a2 100644 Binary files a/docs/assets/react-starter/baseline/invoice.pdf and b/docs/assets/react-starter/baseline/invoice.pdf differ diff --git a/docs/assets/react-starter/baseline/verification.json b/docs/assets/react-starter/baseline/verification.json index 0837cdb..df01e7e 100644 --- a/docs/assets/react-starter/baseline/verification.json +++ b/docs/assets/react-starter/baseline/verification.json @@ -1,14 +1,14 @@ { - "package": "0.8.1", - "engine": "2.5.35", - "node": "v22.23.3", + "package": "0.8.4", + "engine": "2.5.40", + "node": "v22.23.4", "records": [ { "design": "invoice", "pages": 1, - "pdfSha256": "3078d155f30536f5ad721f7be3c241cd78661ae41249131fc0fd65f37f23e408", + "pdfSha256": "85c991aff1d8c5f846e7a7ec218e26c2a9c818f2436aba218f7eb665d6120db0", "previews": [ - "72420749ccc3deaa8025daf7baffcdf79be716b6e8e93ed605effebed01e86c7" + "06a968aee07f77fa11a8d8f417953fb62eeecee2eb76c43b246ae1a5aff75894" ] }, { @@ -77,5 +77,7 @@ ], "repeatedPdfPreviewsEqual": true } - ] + ], + "source_commit": "400f362841ed7482c5afc05efc3a2446888f5285", + "verification_run": 41185271821 } diff --git a/docs/assets/react-starter/invoice-verification.json b/docs/assets/react-starter/invoice-verification.json new file mode 100644 index 0000000..415ee82 --- /dev/null +++ b/docs/assets/react-starter/invoice-verification.json @@ -0,0 +1,339 @@ +{ + "ok": true, + "at": "2026-10-31T08:32:10.323467+00:00", + "kind": "react", + "browser": "chrome", + "browserVersion": "156.0.8078.47", + "cases": [ + { + "name": "short", + "pages": 1, + "items": 3, + "pdfSha256": "85c991aff1d8c5f846e7a7ec218e26c2a9c818f2436aba218f7eb665d6120db0", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 979, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + } + ], + "previewSha256": [ + "06a968aee07f77fa11a8d8f417953fb62eeecee2eb76c43b246ae1a5aff75894" + ] + }, + { + "name": "long", + "pages": 3, + "items": 24, + "pdfSha256": "9ab155fb46cc991e71de731c710c1b1236247a0fe129aafe719b6e807a639af7", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 914, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 963, + "textBox": [ + 45.80999755859375, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 638, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + } + ], + "previewSha256": [ + "2163f992bd3945fd611c8b60353ea0504e9e3ba9ec36add1121481d9a83debdd", + "f239a2115cdc284232941e87768400a79eb40842b5622995428eaf0211d5eb74", + "835f8f28eac1b957b92b5c4818fe67f3a1ed0762bc8046d930ea5af76511b589" + ], + "repeatPdfBytesMatch": true + }, + { + "name": "empty", + "pages": 1, + "items": 0, + "pdfSha256": "fda9fadbcf60e4ac4ddf549d5ebe71e1f9b3fa65098166dd14e63950c7b1402f", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 723, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + } + ], + "previewSha256": [ + "63090086db7abaf17e990f6b946d2466be2da18d48f8ad2c20b4978a0f0e9a7f" + ] + }, + { + "name": "wrapped", + "pages": 3, + "items": 12, + "pdfSha256": "3964a30443701c291cbba814653b54b7072c0c1ae21df97b7a58bb95653345fe", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 1559, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 2040, + "textBox": [ + 45.705997467041016, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 644, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + } + ], + "previewSha256": [ + "4d76aade737f3e3088c6d32fd20dbd18cf6a181da7e80897570a3cf793ff0fe3", + "41955e0e7565ca9f2b49d6f05d16c95557d83f7692e3c778b6b8f77e3cd08f72", + "ac0c8b36d140f481401245bafb06ec5f4df98a756483c0ff32e4cf27ac5eed0b" + ] + }, + { + "name": "boundary-4", + "pages": 2, + "items": 4, + "pdfSha256": "9574eb156a927b8e81a086ce6ebba9e09294368086410cdb2ea22e6c0c69a189", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 707, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.428955078125, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "008eb10f532151cb311dc2fb139bb22da33c69cb69e208daa9fdb26209210d9f", + "60bf7ff29dfe9eb6564e2eb5d266339fb068153e5fd7b4da54d8aca769d6119e" + ] + }, + { + "name": "boundary-5", + "pages": 2, + "items": 5, + "pdfSha256": "902d130eceb3a3102b90bee459ff3f23f4a3e45d0c288e6c73fc2d206888e1bd", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 776, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.428955078125, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "5eeba8c80fd061365bf894765b2d6455feba877bc332e426a34172270e4e0ea5", + "fa227c93cda219eff4f2df7f4ed765c7576d309a1ae0cc820b92c313fe3aa1d3" + ] + }, + { + "name": "boundary-16", + "pages": 3, + "items": 16, + "pdfSha256": "63252296fb4efc1c15207ca570425c8da496a95929574e5460d881a77cf1e4a5", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 914, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 687, + "textBox": [ + 45.80999755859375, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5040893554688, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "2163f992bd3945fd611c8b60353ea0504e9e3ba9ec36add1121481d9a83debdd", + "5ec48a902be0577baee96b518108ce86dc4521e1ea195e423c743e945236ebc0", + "0c3e44c85d619aec5184628b392bb128656525ae2b0ab351d92e216b8edc256b" + ] + }, + { + "name": "boundary-17", + "pages": 3, + "items": 17, + "pdfSha256": "89639fcb94d3c98d70546df833e8ff6bb6bbefa35fbbf250632535c6c1446e2b", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 914, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 756, + "textBox": [ + 45.80999755859375, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5040893554688, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "2163f992bd3945fd611c8b60353ea0504e9e3ba9ec36add1121481d9a83debdd", + "c2f4069f46d8c9ad8f37549ce27358ae88223d530e5b99da4779b321c700e9c9", + "68207462f4a24363b264ad22bee0cdef9b1c0507ed9fbf809c82dd5852ad29ce" + ] + } + ], + "sourceSha256": { + "html": "15829aaf6c698acc36c10111d657c84d346109e5196abc3381616de7c54ffe66", + "css": "3697ea678ffdb56cd438d7ea9fcedd83b7d0d48c40c3c4755ef6091fa7a12cb8" + }, + "errors": [], + "nonGetRequests": 0, + "scope": "These synthetic invoice records, actual PDF downloads and displayed previews. No universal layout, accessibility, conformance or adoption claim.", + "source_commit": "400f362841ed7482c5afc05efc3a2446888f5285", + "package_version": "0.8.4", + "engine_version": "2.5.40", + "zip_sha256": "80131dd214306ce97c0f9bb46cec27957ee8212c60fd05797fb19626c1ebfaa8" +} diff --git a/docs/assets/react-starter/project.zip b/docs/assets/react-starter/project.zip index caaa98b..a259517 100644 Binary files a/docs/assets/react-starter/project.zip and b/docs/assets/react-starter/project.zip differ diff --git a/docs/assets/react-starter/source.json b/docs/assets/react-starter/source.json index aeb1eea..e42b9a6 100644 --- a/docs/assets/react-starter/source.json +++ b/docs/assets/react-starter/source.json @@ -1,17 +1,17 @@ { "source_repository": "https://github.com/fullbleed-engine/fullbleed-node", - "source_commit": "6e266eadca484b826c67d0bf75d7a042c3f159a3", + "source_commit": "400f362841ed7482c5afc05efc3a2446888f5285", "source_directory": "examples/react", "package_version": "0.8.4", "engine_version": "2.5.40", "react_version": "19.3.0", "package_integrity": "sha512-/8UA7by0SyGdqj9OH0g3J5J4TldQJRT9cMUfaX3DMXvkOZ7DeSzOzvE5v5lN3CBY4prcllc/u3ZSEK+ZEbrTaw==", - "zip_bytes": 37382, - "zip_sha256": "bfc26aa0fed6ddd53c95f0bd940ef033a5c0f36db06d767a3434dc8086f1a255", + "zip_bytes": 37645, + "zip_sha256": "80131dd214306ce97c0f9bb46cec27957ee8212c60fd05797fb19626c1ebfaa8", "files": { "fullbleed-react-starter/.gitignore": "0c8c1daabb918a54d7e75061883a887e9e0039d533487324a895ebe46afe15d8", "fullbleed-react-starter/LICENSE": "36a2115938f6e68cf0d87eccff7a6a3e57c17017e909cbd640d51aff1fa0c5a9", - "fullbleed-react-starter/README.md": "882e5df59135b727b9b2587c159dfa14a2fc5cfe315d53aa5983b1732b576670", + "fullbleed-react-starter/README.md": "0520b68e252648ad97e717941e5fc15a23f94f0c9fb3887f64af221e9be8f841", "fullbleed-react-starter/index.html": "1e07a2b52074ed0add251f642fe7f06ae2ac56cc391d54c3d7cfcda0c84a7058", "fullbleed-react-starter/package-lock.json": "7a8a91482a240ceecc889d7918c2dd437ab6bf6054014c2c17765f1ec55aad46", "fullbleed-react-starter/package.json": "9b7f989512ec542ee63b9be754fe7266b1e49565c997b1c215e874dac6d98ab7", @@ -20,8 +20,8 @@ "fullbleed-react-starter/src/documents/Invoice.tsx": "6737ef4e107935cf0e66291f1ef1576d6aef37e647555e81ce875bf37a5cb589", "fullbleed-react-starter/src/documents/data.ts": "c05c98fb07deaef2140f53df4f83670f138d6cad4a453fe09f423f7adb076f70", "fullbleed-react-starter/src/documents/invoiceStyles.ts": "d9d63ef41fccae67d1a36de315b348c56ab5a680a18b0b2c43ffd63c46f18895", - "fullbleed-react-starter/src/invoice.css": "0b310ce0f2964fd6b9b68e4afafa9307b4ff8c6b2f1fc753367dc755620ce427", - "fullbleed-react-starter/src/invoice.html": "1f065ad6694021649e61b3f666cba6dc01aacdcbd8e80e97425b383e60d7d2fe", + "fullbleed-react-starter/src/invoice.css": "3697ea678ffdb56cd438d7ea9fcedd83b7d0d48c40c3c4755ef6091fa7a12cb8", + "fullbleed-react-starter/src/invoice.html": "15829aaf6c698acc36c10111d657c84d346109e5196abc3381616de7c54ffe66", "fullbleed-react-starter/src/main.tsx": "f8f523ef5fc0b1e4095830466e0caa648c01f7b42036694b800c25d43d5e2c84", "fullbleed-react-starter/src/report.css": "519591ae75c239ec602324f008dd99108ebeae0b9306df7215fa5f0442905473", "fullbleed-react-starter/src/report.html": "46b0e975d43914c8b4492218feae09ea0ad684091a9f9ee3b18f66a87202e521", @@ -31,5 +31,5 @@ "fullbleed-react-starter/vite.config.js": "2a300aafa93df7e0269d06d104960ee5ac4d64989d37d61ca482c4b88db3629c" }, "verification_workflow": "https://github.com/fullbleed-engine/fullbleed-node/actions/workflows/react-starter.yml", - "local_ui_evidence": "https://docs.fullbleed.dev/assets/browser-starters-084-verification.json" + "local_ui_evidence": "https://docs.fullbleed.dev/assets/react-starter/invoice-verification.json" } diff --git a/docs/assets/vue-starter/baseline/invoice-1.png b/docs/assets/vue-starter/baseline/invoice-1.png index 5918b8c..bfba0d1 100644 Binary files a/docs/assets/vue-starter/baseline/invoice-1.png and b/docs/assets/vue-starter/baseline/invoice-1.png differ diff --git a/docs/assets/vue-starter/baseline/invoice.pdf b/docs/assets/vue-starter/baseline/invoice.pdf index caf8fe6..f5943a2 100644 Binary files a/docs/assets/vue-starter/baseline/invoice.pdf and b/docs/assets/vue-starter/baseline/invoice.pdf differ diff --git a/docs/assets/vue-starter/baseline/verification.json b/docs/assets/vue-starter/baseline/verification.json index 31bea42..32a30a5 100644 --- a/docs/assets/vue-starter/baseline/verification.json +++ b/docs/assets/vue-starter/baseline/verification.json @@ -1,14 +1,14 @@ { - "package": "0.8.1", - "engine": "2.5.35", - "node": "v22.23.3", + "package": "0.8.4", + "engine": "2.5.40", + "node": "v22.23.4", "records": [ { "design": "invoice", "pages": 1, - "pdfSha256": "3078d155f30536f5ad721f7be3c241cd78661ae41249131fc0fd65f37f23e408", + "pdfSha256": "85c991aff1d8c5f846e7a7ec218e26c2a9c818f2436aba218f7eb665d6120db0", "previews": [ - "72420749ccc3deaa8025daf7baffcdf79be716b6e8e93ed605effebed01e86c7" + "06a968aee07f77fa11a8d8f417953fb62eeecee2eb76c43b246ae1a5aff75894" ] }, { @@ -21,5 +21,7 @@ "8c8bfdc01ef7a3c376fbe61a0736dbc5b65280b0781f0040c550e097e71a5dcd" ] } - ] + ], + "source_commit": "400f362841ed7482c5afc05efc3a2446888f5285", + "verification_run": 41185271823 } diff --git a/docs/assets/vue-starter/invoice-verification.json b/docs/assets/vue-starter/invoice-verification.json new file mode 100644 index 0000000..c5be927 --- /dev/null +++ b/docs/assets/vue-starter/invoice-verification.json @@ -0,0 +1,339 @@ +{ + "ok": true, + "at": "2026-10-31T08:32:09.635550+00:00", + "kind": "vue", + "browser": "chrome", + "browserVersion": "156.0.8078.47", + "cases": [ + { + "name": "short", + "pages": 1, + "items": 3, + "pdfSha256": "85c991aff1d8c5f846e7a7ec218e26c2a9c818f2436aba218f7eb665d6120db0", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 979, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + } + ], + "previewSha256": [ + "06a968aee07f77fa11a8d8f417953fb62eeecee2eb76c43b246ae1a5aff75894" + ] + }, + { + "name": "long", + "pages": 3, + "items": 24, + "pdfSha256": "9ab155fb46cc991e71de731c710c1b1236247a0fe129aafe719b6e807a639af7", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 914, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 963, + "textBox": [ + 45.80999755859375, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 638, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + } + ], + "previewSha256": [ + "2163f992bd3945fd611c8b60353ea0504e9e3ba9ec36add1121481d9a83debdd", + "f239a2115cdc284232941e87768400a79eb40842b5622995428eaf0211d5eb74", + "835f8f28eac1b957b92b5c4818fe67f3a1ed0762bc8046d930ea5af76511b589" + ], + "repeatPdfBytesMatch": true + }, + { + "name": "empty", + "pages": 1, + "items": 0, + "pdfSha256": "fda9fadbcf60e4ac4ddf549d5ebe71e1f9b3fa65098166dd14e63950c7b1402f", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 723, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + } + ], + "previewSha256": [ + "63090086db7abaf17e990f6b946d2466be2da18d48f8ad2c20b4978a0f0e9a7f" + ] + }, + { + "name": "wrapped", + "pages": 3, + "items": 12, + "pdfSha256": "3964a30443701c291cbba814653b54b7072c0c1ae21df97b7a58bb95653345fe", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 1559, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 2040, + "textBox": [ + 45.705997467041016, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 644, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + } + ], + "previewSha256": [ + "4d76aade737f3e3088c6d32fd20dbd18cf6a181da7e80897570a3cf793ff0fe3", + "41955e0e7565ca9f2b49d6f05d16c95557d83f7692e3c778b6b8f77e3cd08f72", + "ac0c8b36d140f481401245bafb06ec5f4df98a756483c0ff32e4cf27ac5eed0b" + ] + }, + { + "name": "boundary-4", + "pages": 2, + "items": 4, + "pdfSha256": "9574eb156a927b8e81a086ce6ebba9e09294368086410cdb2ea22e6c0c69a189", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 707, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.428955078125, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "008eb10f532151cb311dc2fb139bb22da33c69cb69e208daa9fdb26209210d9f", + "60bf7ff29dfe9eb6564e2eb5d266339fb068153e5fd7b4da54d8aca769d6119e" + ] + }, + { + "name": "boundary-5", + "pages": 2, + "items": 5, + "pdfSha256": "902d130eceb3a3102b90bee459ff3f23f4a3e45d0c288e6c73fc2d206888e1bd", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 776, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.428955078125, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "5eeba8c80fd061365bf894765b2d6455feba877bc332e426a34172270e4e0ea5", + "fa227c93cda219eff4f2df7f4ed765c7576d309a1ae0cc820b92c313fe3aa1d3" + ] + }, + { + "name": "boundary-16", + "pages": 3, + "items": 16, + "pdfSha256": "63252296fb4efc1c15207ca570425c8da496a95929574e5460d881a77cf1e4a5", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 914, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 687, + "textBox": [ + 45.80999755859375, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5040893554688, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "2163f992bd3945fd611c8b60353ea0504e9e3ba9ec36add1121481d9a83debdd", + "5ec48a902be0577baee96b518108ce86dc4521e1ea195e423c743e945236ebc0", + "0c3e44c85d619aec5184628b392bb128656525ae2b0ab351d92e216b8edc256b" + ] + }, + { + "name": "boundary-17", + "pages": 3, + "items": 17, + "pdfSha256": "89639fcb94d3c98d70546df833e8ff6bb6bbefa35fbbf250632535c6c1446e2b", + "allTextWithinPage": true, + "orderedItemsOnce": true, + "repeatedTableHeadings": true, + "pageCounters": true, + "totalAndPaymentTogether": true, + "pageBounds": [ + { + "page": 1, + "characters": 914, + "textBox": [ + 45.558998107910156, + 24.677032470703125, + 549.5474243164062, + 795.6810302734375 + ] + }, + { + "page": 2, + "characters": 756, + "textBox": [ + 45.80999755859375, + 24.677032470703125, + 549.5474243164062, + 786.72998046875 + ] + }, + { + "page": 3, + "characters": 336, + "textBox": [ + 44.89199447631836, + 24.677032470703125, + 549.5040893554688, + 769.406494140625 + ] + } + ], + "previewSha256": [ + "2163f992bd3945fd611c8b60353ea0504e9e3ba9ec36add1121481d9a83debdd", + "c2f4069f46d8c9ad8f37549ce27358ae88223d530e5b99da4779b321c700e9c9", + "68207462f4a24363b264ad22bee0cdef9b1c0507ed9fbf809c82dd5852ad29ce" + ] + } + ], + "sourceSha256": { + "html": "15829aaf6c698acc36c10111d657c84d346109e5196abc3381616de7c54ffe66", + "css": "3697ea678ffdb56cd438d7ea9fcedd83b7d0d48c40c3c4755ef6091fa7a12cb8" + }, + "errors": [], + "nonGetRequests": 0, + "scope": "These synthetic invoice records, actual PDF downloads and displayed previews. No universal layout, accessibility, conformance or adoption claim.", + "source_commit": "400f362841ed7482c5afc05efc3a2446888f5285", + "package_version": "0.8.4", + "engine_version": "2.5.40", + "zip_sha256": "ed77cac828c017dbd94e943b4364ff91f8e88458a6769e0028346ca3a1106ffe" +} diff --git a/docs/assets/vue-starter/project.zip b/docs/assets/vue-starter/project.zip index 8be9d1f..4546685 100644 Binary files a/docs/assets/vue-starter/project.zip and b/docs/assets/vue-starter/project.zip differ diff --git a/docs/assets/vue-starter/source.json b/docs/assets/vue-starter/source.json index ccbb404..e1cc71f 100644 --- a/docs/assets/vue-starter/source.json +++ b/docs/assets/vue-starter/source.json @@ -1,25 +1,25 @@ { "source_repository": "https://github.com/fullbleed-engine/fullbleed-node", - "source_commit": "6e266eadca484b826c67d0bf75d7a042c3f159a3", + "source_commit": "400f362841ed7482c5afc05efc3a2446888f5285", "source_directory": "examples/vue", "package_version": "0.8.4", "engine_version": "2.5.40", "vue_version": "3.5.43", "package_integrity": "sha512-/8UA7by0SyGdqj9OH0g3J5J4TldQJRT9cMUfaX3DMXvkOZ7DeSzOzvE5v5lN3CBY4prcllc/u3ZSEK+ZEbrTaw==", - "zip_bytes": 31352, - "zip_sha256": "0c196f235eeb758d72db32e4dee79ab3fb9185b2b1e319cc65017962485ca0c5", + "zip_bytes": 31616, + "zip_sha256": "ed77cac828c017dbd94e943b4364ff91f8e88458a6769e0028346ca3a1106ffe", "files": { "fullbleed-vue-starter/.gitignore": "c023fec2bf12476cb47709e859f1fbb785aeb1e03281e52141e0bee1ee7dad72", "fullbleed-vue-starter/LICENSE": "36a2115938f6e68cf0d87eccff7a6a3e57c17017e909cbd640d51aff1fa0c5a9", - "fullbleed-vue-starter/README.md": "e90ae46c543ed01b69604270ec7db56e6b795cedffe0e8220090eb543c8ec84b", + "fullbleed-vue-starter/README.md": "e3d6b345bb665cae8ac38af25fb1217d4e3382f6b24b02b81e0d015955a38c77", "fullbleed-vue-starter/index.html": "9e1c7f227063911ce44edf02e240f40b628ce3ad66f0f99d68d3c4f8dfbc223b", "fullbleed-vue-starter/package-lock.json": "0e951173cc62bc1046386a4b8c698dfd8a301042262d43262ff3d72367c8d89a", "fullbleed-vue-starter/package.json": "5bbef4eec03ac2d30a68ce964a0644bbafd746b84c5cbc35b12f70fa2200c9e4", "fullbleed-vue-starter/public/favicon.svg": "14e54700b07ee8762556b4fdeb1b406bfc79492bc1d6958e3f97dbd83c2cd0d0", "fullbleed-vue-starter/src/App.vue": "0afa15196ccedd0b0f91293cc5e362799149a2752c59deaa377f4533825ea2af", "fullbleed-vue-starter/src/DocumentEditor.vue": "a3f3f8096d194e1eed6cd0cf2fb0a0606a04d40823ff7b794b9b1a0dbfd8c28a", - "fullbleed-vue-starter/src/invoice.css": "0b310ce0f2964fd6b9b68e4afafa9307b4ff8c6b2f1fc753367dc755620ce427", - "fullbleed-vue-starter/src/invoice.html": "1f065ad6694021649e61b3f666cba6dc01aacdcbd8e80e97425b383e60d7d2fe", + "fullbleed-vue-starter/src/invoice.css": "3697ea678ffdb56cd438d7ea9fcedd83b7d0d48c40c3c4755ef6091fa7a12cb8", + "fullbleed-vue-starter/src/invoice.html": "15829aaf6c698acc36c10111d657c84d346109e5196abc3381616de7c54ffe66", "fullbleed-vue-starter/src/main.ts": "d6d44427a8c817da9a1a8f6809a0d6e1fff87f73ee695442f174fca32db8e6f6", "fullbleed-vue-starter/src/report.css": "519591ae75c239ec602324f008dd99108ebeae0b9306df7215fa5f0442905473", "fullbleed-vue-starter/src/report.html": "46b0e975d43914c8b4492218feae09ea0ad684091a9f9ee3b18f66a87202e521", @@ -29,5 +29,5 @@ "fullbleed-vue-starter/vite.config.js": "dfcc6c065fb26ada03802def672108735f4c2c35e0f30d11965ddfa796b8a0c0" }, "verification_workflow": "https://github.com/fullbleed-engine/fullbleed-node/actions/workflows/vue-starter.yml", - "local_ui_evidence": "https://docs.fullbleed.dev/assets/browser-starters-084-verification.json" + "local_ui_evidence": "https://docs.fullbleed.dev/assets/vue-starter/invoice-verification.json" } diff --git a/docs/guides/browser-pdf.md b/docs/guides/browser-pdf.md index f135b2d..36a70e5 100644 --- a/docs/guides/browser-pdf.md +++ b/docs/guides/browser-pdf.md @@ -75,6 +75,18 @@ also edit those project files directly. The invoice uses `{{customer}}` and `{{r in HTML and `{{ink}}` in CSS; `src/main.js` fills those values and escapes text. Replace the fictional line items and calculations when building your application. +### Add rows to the HTML invoice + +Add `` rows inside `src/invoice.html`'s `` and update both sample +totals. The HTML template does not calculate amounts. It can continue onto new +pages with repeated column headings and `Page N of M` footers. Keep the `@page` +margins and `.closing` group in `src/invoice.css`; that group holds the totals +and payment details together, moving them to a new page when needed. + +The [invoice checks](../assets/browser-starter/invoice-verification.json) cover +the short sample, 24 rows, wrapped descriptions, empty rows and page boundaries. +The 24-row sample produces three pages, with all text inside the PDF page bounds. + ## Add the browser SDK to an existing app Install the package and copy its runtime into the directory your framework @@ -170,4 +182,5 @@ PDF text and independently specified colors in both the PDF and its preview. Nested quotation checks cover inline, block, and contents layouts through the actual editor. They check both PDF readers, page size, and visible preview output. The [retained starter verification](../assets/browser-starters-084-verification.json) -records these cases and the unchanged invoice and report downloads. +records the earlier editor cases and their original invoice and report downloads. +The invoice checks above cover the flowing template in the current download. diff --git a/docs/guides/react-pdf.md b/docs/guides/react-pdf.md index 1813dac..7393db4 100644 --- a/docs/guides/react-pdf.md +++ b/docs/guides/react-pdf.md @@ -118,6 +118,18 @@ totals and payment text respond to the form. Supply your own dates and records when building an application. The optional HTML invoice fills `{{customer}}` and `{{reference}}` in HTML and `{{ink}}` in CSS, with escaped customer text. +### Add rows to the HTML invoice + +Add `` rows inside `src/invoice.html`'s `` and update both sample +totals. The HTML template does not calculate amounts. It can continue onto new +pages with repeated column headings and `Page N of M` footers. Keep the `@page` +margins and `.closing` group in `src/invoice.css`; that group holds the totals +and payment details together, moving them to a new page when needed. + +The [invoice checks](../assets/react-starter/invoice-verification.json) cover +the short sample, 24 rows, wrapped descriptions, empty rows and page boundaries. +The 24-row sample produces three pages, with all text inside the PDF page bounds. + Use [supported Fullbleed print CSS](../css-coverage.md). The SDK consumes static HTML/CSS rather than capturing the React page. Document scripts do not execute, and document URLs do not fetch remote resources. Pass extra font or image bytes @@ -230,4 +242,5 @@ PDF text and independently specified colors in both the PDF and its preview. Nested quotation checks cover inline, block, and contents layouts through the actual editor. They check both PDF readers, page size, and visible preview output. The [retained starter verification](../assets/browser-starters-084-verification.json) -records these cases and the unchanged invoice and report downloads. +records the earlier editor cases and their original invoice and report downloads. +The invoice checks above cover the flowing template in the current download. diff --git a/docs/guides/vue-pdf.md b/docs/guides/vue-pdf.md index a320c11..cddbda1 100644 --- a/docs/guides/vue-pdf.md +++ b/docs/guides/vue-pdf.md @@ -76,6 +76,18 @@ The app escapes customer text before inserting it and validates the hex color. Line items, totals, addresses, and dates are fixed samples: replace them with your data and calculations. +### Add rows to the HTML invoice + +Add `` rows inside `src/invoice.html`'s `` and update both sample +totals. The HTML template does not calculate amounts. It can continue onto new +pages with repeated column headings and `Page N of M` footers. Keep the `@page` +margins and `.closing` group in `src/invoice.css`; that group holds the totals +and payment details together, moving them to a new page when needed. + +The [invoice checks](../assets/vue-starter/invoice-verification.json) cover +the short sample, 24 rows, wrapped descriptions, empty rows and page boundaries. +The 24-row sample produces three pages, with all text inside the PDF page bounds. + Print templates are separate from Vue component templates. Fullbleed consumes static HTML/CSS and does not capture the Vue page. Use [supported print CSS](../css-coverage.md). Document scripts do not execute, and @@ -182,4 +194,5 @@ PDF text and independently specified colors in both the PDF and its preview. Nested quotation checks cover inline, block, and contents layouts through the actual editor. They check both PDF readers, page size, and visible preview output. The [retained starter verification](../assets/browser-starters-084-verification.json) -records these cases and the unchanged invoice and report downloads. +records the earlier editor cases and their original invoice and report downloads. +The invoice checks above cover the flowing template in the current download. diff --git a/tools/check_starter_invoices.py b/tools/check_starter_invoices.py new file mode 100644 index 0000000..901b367 --- /dev/null +++ b/tools/check_starter_invoices.py @@ -0,0 +1,182 @@ +"""Check actual starter invoice downloads, final text bounds, and all previews.""" +import argparse +import base64 +from datetime import datetime, timezone +from hashlib import sha256 +from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer +import json +from pathlib import Path +import threading +from urllib.parse import unquote, urlsplit +from zipfile import ZipFile + +from playwright.sync_api import sync_playwright, expect +from starter_invoice import cases, inspect + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--kind', choices=['browser', 'react', 'vue'], required=True) + site = parser.add_mutually_exclusive_group(required=True) + site.add_argument('--dist', type=Path) + site.add_argument('--origin', help='URL of the deployed starter, including its path.') + source = parser.add_mutually_exclusive_group(required=True) + source.add_argument('--templates', type=Path) + source.add_argument('--archive', type=Path, help='The exact downloaded starter ZIP.') + parser.add_argument('--out', type=Path, required=True) + parser.add_argument('--browser', choices=['chrome', 'firefox', 'webkit'], default='chrome') + parser.add_argument('--quick', action='store_true', help='Check the short and 24-row invoices only.') + parser.add_argument('--reference', type=Path, help='Compare PDF and every preview byte with a prior verification.') + args = parser.parse_args() + out = args.out.resolve() + out.mkdir(parents=True, exist_ok=False) + if args.templates: + original = (args.templates / 'invoice.html').read_text(encoding='utf-8') + css = (args.templates / 'invoice.css').read_text(encoding='utf-8') + else: + with ZipFile(args.archive) as archive: + assert archive.testzip() is None + prefix = f'fullbleed-{args.kind}-starter/src/' + original = archive.read(prefix + 'invoice.html').decode('utf-8').replace('\r\n', '\n') + css = archive.read(prefix + 'invoice.css').decode('utf-8').replace('\r\n', '\n') + fixtures = cases(original, css) + if args.quick: + fixtures = fixtures[:2] + reference = {} + if args.reference: + proof = json.loads(args.reference.read_text(encoding='utf-8')) + assert proof['ok'] + reference = {case['name']: case for case in proof['cases']} + assert all(case['name'] in reference for case in fixtures) + server = None + thread = None + if args.dist: + root = args.dist.resolve() + prefix = '/nested/invoices/' + + class Handler(SimpleHTTPRequestHandler): + def __init__(self, *a, **kw): + super().__init__(*a, directory=str(root), **kw) + + def translate_path(self, raw): + path = unquote(urlsplit(raw).path) + if not path.startswith(prefix): + return str(root / 'does-not-exist') + resolved = (root / path[len(prefix):]).resolve() + return str(resolved if resolved.is_relative_to(root) else root / 'does-not-exist') + + def end_headers(self): + self.send_header('Cache-Control', 'no-store') + super().end_headers() + + def copyfile(self, source, output): + try: + super().copyfile(source, output) + except (BrokenPipeError, ConnectionResetError, ConnectionAbortedError): + pass + + def log_message(self, *args): + pass + + server = ThreadingHTTPServer(('127.0.0.1', 0), Handler) + thread = threading.Thread(target=server.serve_forever, daemon=True) + thread.start() + origin = f'http://127.0.0.1:{server.server_port}{prefix}' + else: + origin = args.origin.rstrip('/') + '/' + records = [] + network = [] + errors = [] + try: + with sync_playwright() as p: + browser = p.chromium.launch(channel='chrome') if args.browser == 'chrome' else getattr(p, args.browser).launch() + context = browser.new_context(viewport={'width': 1440, 'height': 1000}, accept_downloads=True) + page = context.new_page() + page.on('request', lambda r: network.append({'method': r.method, 'url': r.url})) + page.on('pageerror', lambda error: errors.append(str(error))) + + def ready(): + expect(page.locator('#download')).to_be_enabled(timeout=60000) + expect(page.locator('#status')).to_contain_text('Ready.') + + def download(path): + with page.expect_download() as event: + page.locator('#download').click() + event.value.save_as(path) + + try: + page.goto(origin + '?design=invoice', wait_until='domcontentloaded') + ready() + if page.locator('#auto-preview').count(): + page.locator('#auto-preview').uncheck() + page.locator('#template-editor summary').click() + assert page.locator('#html-source').input_value() == original + assert page.locator('#css-source').input_value() == css + for fixture in fixtures: + folder = out / fixture['name'] + folder.mkdir() + page.locator('#html-source').fill(fixture['html']) + page.locator('#generate').click() + ready() + (folder / 'input.html').write_text(fixture['html'], encoding='utf-8', newline='\n') + (folder / 'style.css').write_text(css, encoding='utf-8', newline='\n') + download(folder / 'document.pdf') + result = inspect(folder / 'document.pdf', fixture) + previews = page.locator('#preview img') + expect(previews).to_have_count(result['pages']) + result['previewSha256'] = [] + for index in range(result['pages']): + encoded = previews.nth(index).evaluate('''async image => { + const bytes = new Uint8Array(await (await fetch(image.src)).arrayBuffer()); + let text = ''; for (const byte of bytes) text += String.fromCharCode(byte); return btoa(text); + }''') + data = base64.b64decode(encoded, validate=True) + assert data.startswith(b'\x89PNG\r\n\x1a\n') + (folder / f'page-{index + 1}.png').write_bytes(data) + result['previewSha256'].append(sha256(data).hexdigest()) + if reference: + prior = reference[fixture['name']] + assert result['pdfSha256'] == prior['pdfSha256'], fixture['name'] + assert result['previewSha256'] == prior['previewSha256'], fixture['name'] + result['pdfAndPreviewsMatchReference'] = True + if fixture['name'] == 'long': + for width, height in [(1440, 1000), (390, 844), (320, 760)]: + page.set_viewport_size({'width': width, 'height': height}) + page.evaluate('window.scrollTo(0, 0)') + assert page.evaluate('document.documentElement.scrollWidth <= innerWidth') + page.screenshot(path=str(folder / f'browser-{width}.png')) + page.set_viewport_size({'width': 1440, 'height': 1000}) + previous = previews.first.get_attribute('src') + page.locator('#generate').click() + ready() + assert previews.first.get_attribute('src') != previous + download(folder / 'repeat.pdf') + assert (folder / 'document.pdf').read_bytes() == (folder / 'repeat.pdf').read_bytes() + result['repeatPdfBytesMatch'] = True + records.append(result) + print(f'{args.kind}/{fixture["name"]}: {result["pages"]} pages, all text within bounds', flush=True) + assert not errors, errors + assert all(row['method'] == 'GET' for row in network) + record = {'ok': True, 'at': datetime.now(timezone.utc).isoformat(), 'kind': args.kind, + 'origin': origin, 'browser': args.browser, 'browserVersion': browser.version, + 'cases': records, 'errors': errors, 'nonGetRequests': 0, + 'sourceSha256': {'html': sha256(original.encode()).hexdigest(), 'css': sha256(css.encode()).hexdigest()}, + 'scope': 'These synthetic invoice records, actual PDF downloads and displayed previews. No universal layout, accessibility, conformance or adoption claim.'} + (out / 'verification.json').write_text(json.dumps(record, indent=2) + '\n', encoding='utf-8') + except Exception: + page.screenshot(path=str(out / 'failure.png')) + (out / 'failure.json').write_text(json.dumps({'cases': records, 'errors': errors, 'network': network}, indent=2) + '\n', encoding='utf-8') + raise + finally: + context.close() + browser.close() + finally: + if server: + server.shutdown() + server.server_close() + thread.join(timeout=5) + print(json.dumps({'ok': True, 'kind': args.kind, 'cases': len(records), 'pages': sum(case['pages'] for case in records)})) + + +if __name__ == '__main__': + main() diff --git a/tools/starter_invoice.py b/tools/starter_invoice.py new file mode 100644 index 0000000..8266670 --- /dev/null +++ b/tools/starter_invoice.py @@ -0,0 +1,83 @@ +"""Synthetic invoice records and independent final-PDF layout checks.""" +from decimal import Decimal +from hashlib import sha256 +from html import escape +import re + +from pypdf import PdfReader +import pypdfium2 as pdfium + + +def cases(original_html, css): + result = [{'name': 'short', 'html': original_html, 'css': css, 'total': '1,870.00', + 'markers': ['Discovery & brand workshop', 'Digital design & implementation', 'Review & studio handoff']}] + for name, count, wrapped in [('long', 24, False), ('empty', 0, False), ('wrapped', 12, True), + *[(f'boundary-{n}', n, False) for n in (4, 5, 16, 17)]]: + markers = [f'Service line {n:03d}' for n in range(1, count + 1)] + detail = 'Synthetic invoice record for pagination review.' + if wrapped: + detail = 'Discuss requirements, prepare the design, implement the agreed changes, and document the handoff. ' * 3 + rows = ''.join('' + escape(marker) + '

' + escape(detail) + + '

1$25.00$25.00' for marker in markers) + html, replacements = re.subn(r'.*?', '' + rows + '', original_html, flags=re.S) + assert replacements == 1 + total = f'{Decimal(count) * Decimal("25.00"):,.2f}' + assert html.count('$1,870.00') == 2 + html = html.replace('$1,870.00', '$' + total) + result.append({'name': name, 'html': html, 'css': css, 'total': total, 'markers': markers}) + return result + + +def inspect(path, fixture): + compact = lambda text: ''.join(text.split()) + reader = PdfReader(path, strict=True) + texts = [compact(page.extract_text()) for page in reader.pages] + joined = ''.join(texts) + positions = [] + item_pages = set() + for marker in fixture['markers']: + marker = compact(marker) + assert joined.count(marker) == 1, (fixture['name'], 'missing or duplicated item', marker) + positions.append(joined.index(marker)) + found = [n for n, text in enumerate(texts) if marker in text] + assert len(found) == 1, (fixture['name'], 'item split across pages', marker) + item_pages.add(found[0]) + assert positions == sorted(positions), (fixture['name'], 'item order') + assert '$' + fixture['total'] in texts[-1] and 'TOTALDUE' in texts[-1] + assert 'Paymentinstructionsaresuppliedseparately.' in texts[-1] + assert any('TOTALDUE' in text and 'Paymentinstructionsaresuppliedseparately.' in text for text in texts) + for n, text in enumerate(texts): + assert text.count(f'Page{n + 1}of{len(texts)}') == 1, (fixture['name'], 'page counter', n + 1) + if n in item_pages: + assert 'DESCRIPTIONHOURSRATEAMOUNT' in text, (fixture['name'], 'table headings', n + 1) + if fixture['name'] in ('short', 'empty'): + assert len(texts) == 1 + elif fixture['name'] in ('long', 'wrapped'): + assert len(texts) > 1 + bounds = [] + with pdfium.PdfDocument(path) as document: + assert len(document) == len(texts) + for n in range(len(document)): + page = document[n] + width, height = page.get_size() + assert abs(width - 595.276) < 0.1 and abs(height - 841.890) < 0.1 + text = page.get_textpage() + boxes = [] + try: + for index in range(text.count_chars()): + if not text.get_text_range(index, 1).strip(): + continue + left, bottom, right, top = text.get_charbox(index) + assert left >= -0.25 and bottom >= -0.25 and right <= width + 0.25 and top <= height + 0.25, ( + fixture['name'], 'text outside visible page', n + 1, index, [left, bottom, right, top]) + boxes.append([left, bottom, right, top]) + assert boxes + bounds.append({'page': n + 1, 'characters': len(boxes), 'textBox': [min(b[0] for b in boxes), + min(b[1] for b in boxes), max(b[2] for b in boxes), max(b[3] for b in boxes)]}) + finally: + text.close() + page.close() + return {'name': fixture['name'], 'pages': len(texts), 'items': len(fixture['markers']), + 'pdfSha256': sha256(path.read_bytes()).hexdigest(), 'allTextWithinPage': True, + 'orderedItemsOnce': True, 'repeatedTableHeadings': True, 'pageCounters': True, + 'totalAndPaymentTogether': True, 'pageBounds': bounds}