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
Hey I am trying your code to generate and download PDF of particular invoice ID, but I am facing some problem.
My Code like this:-
var xero = new Xero(CONSUMER_KEY, CONSUMER_SECRET, RSA_PRIVATE_KEY);
var invoiceId = xxxxxxxxxxxxxxxxxxxx;
var req = xero.call('GET', '/Invoices/' + invoiceId);
req.setHeader('Accept', 'application/pdf');
req.on('response', function(response) {
console.log("Response");
var file = fs.createWriteStream(invoiceId + '.pdf');
response.pipe(file);
console.log("Response after cerateing File");
});
req.end();
Both console.log messages printed but doesn't return anything and Browser continuous loading.
Is there any mistake??
How should I Download pdf of invoice??
The text was updated successfully, but these errors were encountered:
Hey I am trying your code to generate and download PDF of particular invoice ID, but I am facing some problem.
My Code like this:-
var xero = new Xero(CONSUMER_KEY, CONSUMER_SECRET, RSA_PRIVATE_KEY);
var invoiceId = xxxxxxxxxxxxxxxxxxxx;
var req = xero.call('GET', '/Invoices/' + invoiceId);
req.setHeader('Accept', 'application/pdf');
req.on('response', function(response) {
console.log("Response");
var file = fs.createWriteStream(invoiceId + '.pdf');
response.pipe(file);
console.log("Response after cerateing File");
});
req.end();
Both console.log messages printed but doesn't return anything and Browser continuous loading.
Is there any mistake??
How should I Download pdf of invoice??
The text was updated successfully, but these errors were encountered: