|
|
|
|
@ -24,12 +24,8 @@ const signPDF = async (sourceFile, { x = 0, y = 0, sf = 1.0 }) => {
|
|
|
|
|
const pngUrl = signDir;
|
|
|
|
|
const pngSignBytes = fs.readFileSync(signDir);
|
|
|
|
|
const pngStampBytes = fs.readFileSync(stampDir);
|
|
|
|
|
try {
|
|
|
|
|
const pBytes = fs.readFileSync(rawDir + sourceFile);
|
|
|
|
|
const pdfDoc = await PDFDocument.load(pBytes);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
|
|
|
|
const pBytes = fs.readFileSync(rawDir + sourceFile);
|
|
|
|
|
const pdfDoc = await PDFDocument.load(pBytes);
|
|
|
|
|
|
|
|
|
|
// Embed the JPG image bytes and PNG image bytes
|
|
|
|
|
const pngSign = await pdfDoc.embedPng(pngSignBytes);
|
|
|
|
|
|