print file with appendix
This commit is contained in:
parent
9ef82adef7
commit
98ce39efc5
7 changed files with 97 additions and 24 deletions
|
@ -15,7 +15,7 @@ export abstract class FileSystemHelper {
|
|||
return readFileSync(this.formatPath(...filePath), "utf8");
|
||||
}
|
||||
|
||||
static readFileasBase64(...filePath: string[]) {
|
||||
static readFileAsBase64(...filePath: string[]) {
|
||||
this.createFolder(...filePath);
|
||||
return readFileSync(this.formatPath(...filePath), "base64");
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ export abstract class PdfExport {
|
|||
const mergedPdf = await PDFDocument.create();
|
||||
|
||||
for (const pdfPath of pdfFilePaths) {
|
||||
const pdfBytes = FileSystemHelper.readFileasBase64(inputFolder, pdfPath);
|
||||
const pdfBytes = FileSystemHelper.readFileAsBase64(inputFolder, pdfPath);
|
||||
const pdf = await PDFDocument.load(pdfBytes);
|
||||
const copiedPages = await mergedPdf.copyPages(pdf, pdf.getPageIndices());
|
||||
copiedPages.forEach((page) => mergedPdf.addPage(page));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue