You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pdftk is not available on Firebase Cloud Functions, I'm thinking about setting up a VM but I think is too much trouble. Have you resolved spawn pdftk by any chance?
I'm trying to implement a pdf filler within a google firebase (function) environment without much luck.
Has anyone tried this with any success?
const bucket = storage.bucket('somebucket');
const sourcefilename = '/test.pdf';
const sourcePDF = bucket.file(sourcefilename);
const filename = "test-result.pdf";
const file = bucket.file(filename);
const destinationPDF = file.createWriteStream();
var data = {
"last_name": "last",
"first_name": "first",
"date": "Jan 1, 2013",
"football": "Off",
"baseball": "Yes",
"basketball": "Off",
"hockey": "Yes",
"nascar": "Off"
};
const GeneratePDF = (req, res) => {
console.log("here....");
pdfFiller.fillForm(sourcePDF, destinationPDF, data, function (err) {
if (err) throw err;
console.log("In callback (we're done).");
});
};
I think the main issue is around the need to createWriteStream to save to firebase.
Any ideas?
The text was updated successfully, but these errors were encountered: