issueAndArchive keeps an issued invoice even when rendering or archiving fails (Issued - not archived, with a Render & archive action). The export menu offers a searchable PDF or a 300 DPI image-only PDF whose metadata is the invoice number alone; flatten failures offer Retry or searchable export and never silently lower the resolution. History re-exports the original as issued by default and warns when a re-render's layout fingerprint differs. The render client gains a FIFO assemble lane that previews cannot supersede. A Diagnostics panel runs fixtures in the real worker and compares against goldens generated from Node.
11 lines
520 B
TypeScript
11 lines
520 B
TypeScript
import { assembleImagePdf } from "../assemble";
|
|
import { renderBytes } from "./core";
|
|
import type { AssembleJob, AssembleResult } from "./jobs";
|
|
|
|
/** Runs an assemble job where it is called: the worker, the main thread, or a Node test. */
|
|
export async function runAssembleJob(job: AssembleJob): Promise<AssembleResult> {
|
|
const t0 = performance.now();
|
|
const bytes = await renderBytes(assembleImagePdf({ pages: job.pages, title: job.title }));
|
|
return { id: job.id, bytes, ms: Math.round(performance.now() - t0) };
|
|
}
|