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
I have PDF in base 64 encoded form. I want to edit and add an QR image to it using PDF kit.
Somehow when i try to merge the streams the content fails . Below is the code.
var base64 = require('base64-stream');
var PDFDocument = require('pdfkit');
var doc = new PDFDocument ();
doc.image('test.jpeg', {
fit: [250, 300],
align: 'center',
valign: 'center'
});
var finalString = ''; // contains the base64 string
var stream = doc.pipe(base64.encode());
doc.end();
var finalString = '';
stream.on('data', function(chunk) {
finalString += chunk;});
stream.on('end', function() {
// the stream is at its end, so push the resulting base64 string to the response
read.writeFileSync('./report.pdf', finalString);
});
The text was updated successfully, but these errors were encountered:
Hi ,
I have PDF in base 64 encoded form. I want to edit and add an QR image to it using PDF kit.
Somehow when i try to merge the streams the content fails . Below is the code.
var base64 = require('base64-stream');
var PDFDocument = require('pdfkit');
The text was updated successfully, but these errors were encountered: