/**
* Salesforce LWC Integration for PDF Download Popup
* Add this code to your propertyTemplateSelector.js file
*/
// Add this method to your LWC component
showDownloadPopup(pdfResult) {
// Create modal HTML
const modalHTML = `
`;
// Add modal to page
document.body.insertAdjacentHTML('beforeend', modalHTML);
}
// Helper method to format dates
formatDate(dateString) {
if (!dateString) return 'Unknown';
const date = new Date(dateString);
return date.toLocaleString();
}
// Update your existing PDF generation method to show popup
async generatePDFWithPopup() {
try {
// Show loading state
this.showLoading = true;
this.errorMessage = '';
// Call your existing PDF generation method
const result = await PDFGenerationProxy.generatePDFFromHTML(this.htmlContent, 'A4');
if (result.success) {
// Show the download popup
this.showDownloadPopup(result);
} else {
this.errorMessage = result.error || 'PDF generation failed';
}
} catch (error) {
this.errorMessage = error.message || 'An error occurred';
} finally {
this.showLoading = false;
}
}
// Add this to your LWC template to show the popup
//
//
//