Add searchable and flattened export, history re-export and diagnostics self-test
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.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import type { ExportMode } from "./filename";
|
||||
|
||||
const KEY = "voiced.exportMode";
|
||||
|
||||
/** The last export mode this viewer used; searchable until one is chosen. A per-viewer convenience only. */
|
||||
export function loadExportMode(): ExportMode {
|
||||
try {
|
||||
const v = localStorage.getItem(KEY);
|
||||
if (v === "searchable" || v === "flattened") return v;
|
||||
} catch {
|
||||
// Storage can be blocked or empty; the default is fine.
|
||||
}
|
||||
return "searchable";
|
||||
}
|
||||
|
||||
export function saveExportMode(mode: ExportMode): void {
|
||||
try {
|
||||
localStorage.setItem(KEY, mode);
|
||||
} catch {
|
||||
// Not remembering is harmless.
|
||||
}
|
||||
}
|
||||
|
||||
export const EXPORT_MODE_LABEL: Record<ExportMode, string> = {
|
||||
searchable: "Searchable PDF (copy-pasteable text)",
|
||||
flattened: "Flattened PDF (image only)",
|
||||
};
|
||||
Reference in New Issue
Block a user