I am creating a pdf file using html-pdf librarby in node js from an html file.
My code is
const createSettlementPDFFile = function (htmlString, fileName) {
return new Promise((resolve, reject) => {
let filePath = '/tmp/' + fileName;
pdf.create(htmlString, {format: 'A6', timeout: 600000})
.toFile(filePath,function (err, data) {
if (err) {
logger.error('Error while creating the pdf file ::-> ', err.stack);
return reject(err);
} else {
return resolve(data);
}
});
});
};
Is there any option where we can convert it into a single page and increase the width of the pdf page.