增加了自动openpgp签名选项,修改了打印版本的样式
This commit is contained in:
1 parent
2c78a92b25
commit
71b70b3773
51 files changed
+1180
-423
No files matched your search
@@ -1,4 +1,8 @@
|
||||
import { DocuBuilder, IndexBuilder } from "../pdf_builder/builder.ts";
|
||||
import {
|
||||
DocuBuilder,
|
||||
IndexBuilder,
|
||||
OpenPGPSigner,
|
||||
} from "../pdf_builder/builder.ts";
|
||||
|
||||
export async function generate_pdf() {
|
||||
const cfg = JSON.parse(await Deno.readTextFile("config.json"));
|
||||
@@ -111,3 +115,19 @@ export async function use_qpdf() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function sign_pdf() {
|
||||
const config = JSON.parse(await Deno.readTextFile("config.json"));
|
||||
for (const cfg of config.settings) {
|
||||
if (cfg.pdf.signing?.enabled) {
|
||||
console.log(`Signing PDF ${cfg.playwright.path}...`);
|
||||
const signer = new OpenPGPSigner(
|
||||
cfg.playwright.path,
|
||||
cfg.pdf.signing.key_path,
|
||||
cfg.pdf.signing.output_path,
|
||||
);
|
||||
await signer.sign();
|
||||
console.log(`Successfully signed PDF: ${cfg.pdf.signing.output_path}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user