change: selects now use inputmanager

fix: bad exit logic
feat: field rename now supports renaming things with multiple widgets
This commit is contained in:
2025-05-27 12:44:45 -06:00
parent 7a394c642a
commit 0f9c377853
12 changed files with 543 additions and 161 deletions

View File

@@ -1,4 +1,3 @@
import { log } from "./logfile.ts";
import { join } from "@std/path";
export async function getAsciiArt(art: string) {

View File

@@ -9,7 +9,7 @@ logFile.truncateSync(0);
export function log(message: any) {
if (typeof message === "object") {
message = JSON.stringify(message);
message = Deno.inspect(message);
}
logFile.writeSync(new TextEncoder().encode(message + "\n"));
}

View File

@@ -15,10 +15,10 @@ export async function loadPdf(path: string) {
export async function savePdf(doc: PDFDocument, path: string) {
doc.getForm().getFields().forEach((field) => {
if (field instanceof PDFTextField) {
field.disableRichFormatting();
field.disableRichFormatting?.();
}
});
const pdfBytes = await doc.save();
const pdfBytes = await doc.save({ updateFieldAppearances: true });
if (Deno.env.get("DRYRUN") || path.includes("dryrun")) return;
await Deno.writeFile(path, pdfBytes);
}