I would like to ask about how I can save the generated PDF file (via htm2pdf) on a remote server? I know how to save a file, but I do not know how to "pass" it to to the BTOA function which will allow me to upload file; for example:
var pdff = new html2pdf()
.set({ html2canvas: { scale: 3 } })
.from(element)
.save(); //works, allows to download the correct file
var pdf = btoa(pdff.output()); // I know, wrong syntax, how to write it correctly?
$.ajax({
method: "POST",
url: "upload.php?nazwa=" + nazwa,
data: {data: pdf},
}).done(function(data){
console.log(data);
});