hen(doc => {
                // Change the title to show date (now)
                let date = new Date().toLocaleString();
                let title = doc.contents[0].params;
                title.text += " (created: " + date + ")";
                createPDF(doc);
            });
    });

    let pdfFileBlobURL = null;
    let generatePDF = (data) => {
        const blob = new Blob([data], {
            type: 'application/pdf'
        });
        if (pdfFileBlobURL !== null) {
            URL.revokeObjectU