mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-09 09:04:18 +01:00
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:
1 parent
ab651a5970
commit
05e8f6cfde
2 files changed
+62
-11
No files matched your search
@@ -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