I am having trouble creating a PDF at the same time and then sending the same file via e-mail. I tried to use apex_util.get_print_document but I don't know what to enter in p_report_query_name and p_report_layout parameters. I also tried to use html2pdf but I don't know how to send the created pdf to the e-mail attachment. Please help
js:
function pdf_DLoad (p_id) {
var element = document.getElementById(p_id);
var opt = {
margin: 1,
filename: 'myfile.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait'
}
};
html2pdf().set(opt).from(element).outputPdf('datauristring')
.then(function (res)
{
this.blobString = res;
console.log(res);
apex.item("P10_NEW").setValue(res);
});