This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pdfMakePrinter = require('pdfmake/src/printer'); | |
const fs = require('fs'); | |
function generatePdf(docDefinition, successCallback, errorCallback) => { | |
try { | |
const fontDescriptors = { ... }; | |
const printer = new pdfMakePrinter(fontDescriptors); | |
const doc = printer.createPdfKitDocument(docDefinition); | |
doc.pipe( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const docDefinition = { | |
content: ['This will show up in the file created'] | |
}; | |
generatePdf(docDefinition, (response) => { | |
// doc successfully created | |
res.json({ | |
status: 200, | |
data: response | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const warningCodeLookup = { | |
'66': 'warning_low_ink_yellow', | |
'67': 'warning_low_ink_black' | |
} | |
let information = DLLWrapper.GetInformation() | |
if (warningCodeLookup[information.warning_code] == "warning_low_ink_yellow { | |
console.log("Low Ink on Yellow Cartridge") | |
} |
NewerOlder