backup
This commit is contained in:
1 parent
1c8e04c338
commit
02ff381993
1 file changed
-4
@@ -24,12 +24,8 @@ const signPDF = async (sourceFile, { x = 0, y = 0, sf = 1.0 }) => {
|
|||||||
const pngUrl = signDir;
|
const pngUrl = signDir;
|
||||||
const pngSignBytes = fs.readFileSync(signDir);
|
const pngSignBytes = fs.readFileSync(signDir);
|
||||||
const pngStampBytes = fs.readFileSync(stampDir);
|
const pngStampBytes = fs.readFileSync(stampDir);
|
||||||
try {
|
|
||||||
const pBytes = fs.readFileSync(rawDir + sourceFile);
|
const pBytes = fs.readFileSync(rawDir + sourceFile);
|
||||||
const pdfDoc = await PDFDocument.load(pBytes);
|
const pdfDoc = await PDFDocument.load(pBytes);
|
||||||
} catch (error) {
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Embed the JPG image bytes and PNG image bytes
|
// Embed the JPG image bytes and PNG image bytes
|
||||||
const pngSign = await pdfDoc.embedPng(pngSignBytes);
|
const pngSign = await pdfDoc.embedPng(pngSignBytes);
|
||||||
|
|||||||
Reference in new issue
Block a user