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
Hi,
I want to add both orientation portrait and landscape in same pdf but it's not working. Can you help me out how to set opt on every page. Below I had share code.
const downloadPDF2 = (elements, pdfOptions) => {
let worker = html2pdf()
.set(pdfOptions)
.from(elements[0])
if (elements.length > 1) {
worker = worker.toPdf() // worker is now a jsPDF instance
// add each element/page individually to the PDF render process
elements.slice(1).forEach((element, index) => {
worker = worker
.get('pdf')
.then(pdf => {
pdf.addPage()
})
.from(element)
.toContainer()
.toCanvas()
.toPdf()
})
}
worker = worker.save().then(
function (pdf) {
$('body').find('.process-div').html('');
$('body').find('.btn-d').css('display','inline');
},
function(){
$('body').find('.process-div').html('PDF Genration Fail Please Try Again!');
$('body').find('.btn-d').css('display','inline');
}).catch(function (error) {
console.log(error);
/* This is fired when the promise executes without the DOM */
});
}
The text was updated successfully, but these errors were encountered:
Hi,
I want to add both orientation portrait and landscape in same pdf but it's not working. Can you help me out how to set opt on every page. Below I had share code.
const downloadPDF2 = (elements, pdfOptions) => {
The text was updated successfully, but these errors were encountered: