feat(pdf): R4.6 app export on the core's session: export.ts drives ExportSession (rasters one by one, warnings in the engine's order, abort on unmount), labels moved to the app, EditorRoute downloads the Blob of the parts; suites read the file's content streams (pdfRead helper), app-path bytes = R4 digests, hex strings upper-case as pdf-lib

This commit is contained in:
bchanot committed 2026-10-19 01:26:13 +02:00
1 parent 9e688b6801
commit d492bf7112
29 files changed
+507 -131

No files matched your search

+13 -6
View File
@@ -1,12 +1,19 @@
import type { Rasterizer } from '@faunosteo/pdf'
/**
* The browser side of the engine's rasterizer adapter: the engine has fixed
* the pixel size, this module only stamps it on the SVG root and lets the
* browser draw the SVG through an Image / canvas pair, which renders exactly
* what the practitioner sees in the inline anatomy canvas.
* The browser side of the core's raster requests (R4.6; the engine's adapter
* before): the core has fixed the pixel size, this module only stamps it on
* the SVG root and lets the browser draw the SVG through an Image / canvas
* pair, which renders exactly what the practitioner sees in the inline
* anatomy canvas.
*/
export interface RasterSize {
widthPx: number
heightPx: number
}
/** Draws `svg` at `size` as a PNG. */
export type Rasterizer = (svg: string, size: RasterSize) => Promise<Uint8Array>
const SVG_NS = 'http://www.w3.org/2000/svg'
const PNG_SIGNATURE = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]