var doc = new jsPDF();
doc.text(20,20, 'Hello');
var blob = new Blob([doc], {type: 'application/pdf'});
I tried to create a blob from jsPDF object to include it into a zip file by using jsZIP. However, that method did not work.
Is there a way to get the content of the doc object to use it with blob?
var pdf = new jsPDF('p', 'pt', 'a4');
pdf.addHTML(element, function () {
var blob = pdf.output('blob');
});
cheers
Thank you @mnewmedia.
var blob = pdf.output('blob'); is all I needed.
Did it work?
I am trying below code:
var pdf = new jsPDF('p', 'pt', 'letter'),
source = $('#printView')[0],
margins = {
top: 40,
bottom: 40,
left: 40,
right: 40,
width: 522
};
var blob = pdf.output('blob');
but it is not working. I need to get blob object for pdf and send to API. Getting blob for empty pdf.
Did it work?
I am trying below code:
var pdf = new jsPDF('p', 'pt', 'letter'),
source = $('#printView')[0],
margins = {
top: 40,
bottom: 40,
left: 40,
right: 40,
width: 522
};var blob = pdf.output('blob');but it is not working. I need to get blob object for pdf and send to API. Getting blob for empty pdf.
same problem:(
Did it work?
I am trying below code:
var pdf = new jsPDF('p', 'pt', 'letter'),
source = $('#printView')[0],
margins = {
top: 40,
bottom: 40,
left: 40,
right: 40,
width: 522
};var blob = pdf.output('blob');but it is not working. I need to get blob object for pdf and send to API. Getting blob for empty pdf.
Same Problem
Did it work?
I am trying below code:
var pdf = new jsPDF('p', 'pt', 'letter'),
source = $('#printView')[0],
margins = {
top: 40,
bottom: 40,
left: 40,
right: 40,
width: 522
};var blob = pdf.output('blob');but it is not working. I need to get blob object for pdf and send to API. Getting blob for empty pdf.
Same here, not working for. Can someone help me out
Most helpful comment
cheers