I created a desktop application with Electron that allows users to enter information about applicants in a program. My application needs the ability to create and save that information to a .pdf file. I have created the .pdf successfully, but I'm running into a problem concerning where to save them. I would like to create an applicantPDF folder on the user's desktop. I don't necessarily know where the user will keep the application, or where the actual files will be located once the users installs the application. Any ideas on how to set up the file path to go to any user's desktop? I currently just have it going one level out of the application. Code included below.
let content = document.getElementById('finalPageContainer').outerHTML
let fileName = applicant["Personal Information"]["Last Name"] + applicant["Personal Information"]["Identification Number"] + ""
let pdf = require('html-pdf');
pdf.create(content).toFile('../applicantPDF/' + fileName + '.pdf', function(err) {
if (err) return console.log(err);
})
Thank you so much for your help.