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 need to convert the html to image but in base64 format. Currently i am only able to convert to image.
I am getting the image in the local folder when ever i am calling this api in front end. But i dont need to store in local folder i need the base64 string for the html encoded.
On Thu, Feb 14, 2019, 4:44 AM Brittney Kernan ***@***.*** wrote:
You need to remove the imgUrl from arguments.
let body = "data:" + "image/png" + ";base64,";
const renderStream = webshot(camUrl, options).on('data', function(data) {
body += data.toString('base64');
}).on('end', () => {
console.log(body);
console.log(Screenshot taken!);
});
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#231 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALmd3MQD_0-hN1z97h7TzacTlYCjmvrfks5vNJw8gaJpZM4S_eAi>
.
I need to convert the html to image but in base64 format. Currently i am only able to convert to image.
I am getting the image in the local folder when ever i am calling this api in front end. But i dont need to store in local folder i need the base64 string for the html encoded.
app.post('/api/screencapture', function (req, res) {
ImgId = Math.floor(Date.now() / 1000);
imgName = ImgId + '_capture.png'
imgUrl = __dirname + '/public/' + imgName;
imgPath = {};
imgPath.imgpath = imgName;
webshot(req.body.html, imgUrl, options, (err) => {
});
});
Please help me i tried a lot and stuck there.
thanks in advance
The text was updated successfully, but these errors were encountered: