I am using PDFMake to create a PDF file, the body of which is dynamic. When I create the PDF it downloads to my downloads folder.
I would love for the PDF to be able to save to a directory of my choice. I have looked through the PDFMake docs and all I can see is that it gives you the option to give it a custom name. Does anyone know how I can make this happen. I don't want to just retrieve it from the folder it's in because it could possibly be in a different folder depending on the user.
Below is the code where I create the PDF:
function createPDF() {
let body = tinymce.get('elm1').getContent();
let docDefinition = {
content: body
};
console.log(body);
pdfMake.createPdf(docDefinition).download();
}
Example: