feat(form-filler): enhance PDF upload handling and download functionality
Updated the form-filler logic to bypass pdf-lib for XFA forms, utilizing PDF.js for rendering. Added UI elements for form-filler options and improved the process button functionality. Enhanced the download process by implementing checks for the download button in the viewer, providing better user feedback and error handling.
This commit is contained in:
@@ -24,10 +24,21 @@ import * as pdfjsLib from 'pdfjs-dist';
|
||||
async function handleSinglePdfUpload(toolId, file) {
|
||||
showLoader('Loading PDF...');
|
||||
try {
|
||||
// pdf-lib does not support XFA, so we let pdf.js render it
|
||||
// For form-filler, bypass pdf-lib (can't handle XFA) and use PDF.js
|
||||
if (toolId === 'form-filler') {
|
||||
hideLoader();
|
||||
|
||||
const optionsDiv = document.getElementById('form-filler-options');
|
||||
if (optionsDiv) optionsDiv.classList.remove('hidden');
|
||||
|
||||
const processBtn = document.getElementById('process-btn');
|
||||
if (processBtn) {
|
||||
const logic = toolLogic[toolId];
|
||||
if (logic && logic.process) {
|
||||
processBtn.onclick = logic.process;
|
||||
}
|
||||
}
|
||||
|
||||
const logic = toolLogic[toolId];
|
||||
if (logic && logic.setup) {
|
||||
await logic.setup();
|
||||
|
||||
Reference in New Issue
Block a user