Open chaim0m opened 4 years ago
Try this code
var worker = html2pdf() .from(model) .set(opt) .toPdf() .get('pdf') .then(function (pdf) { your code here })
Try this code
var worker = html2pdf() .from(model) .set(opt) .toPdf() .get('pdf') .then(function (pdf) { your code here })
Thanks but that gives me the already converted PDF and not the html, as I understand it. The object looks something like this:
{
"internal":{
"collections":{ },
"events":{
},
"scaleFactor":2.834645669291339,
"pageSize":{ },
"pages":[ ]
},
"__private__":{ },
"CapJoinStyles":{ },
"__acroform__":{
},
"AcroFormAppearance":{ },
"AcroForm":{ },
"color_spaces":{ },
"decode":{ },
"image_compression":{ },
"__arabicParser__":{
},
"adler32cs":{ },
"outline":{ },
"context2d":{ },
"canvas":{
}
The empty objects have data just didnt copy since it is too large. Also I need the html pre conversion to pdf for manipulation not after.
I would like to add a custom class to each div which is created when a page-break is added (this is already supported by the "createElement" function its just not exposed). In this way I can control the behaviour of the newly added div, mainly I would like to style it not simply as a blank space and also allow for extracting the space out of the table it is in which does not look good. Currently I have a row in the table with very little data a giant empty section inside the cell and then the next page contains the next cell. Here is the code I tried using to capture the html:
console logs
undefined
chaining thetoContainer
andtoCanvas
methods yields the sameundefined