Merge pull request #2476 from omar-ahmed42/fix-img-to-pdf-2456

Fix img to pdf merge conversion type
This commit is contained in:
Anthony Stirling 2024-12-17 10:36:38 +00:00 committed by GitHub
commit b3dfdba9cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 7 deletions

View File

@ -75,9 +75,10 @@
// Check if any PDF files are encrypted and handle decryption if necessary
const decryptedFiles = await checkAndDecryptFiles(url, files);
files = decryptedFiles;
formData.delete('fileInput'); // Reset fileInput and Append
// Append decrypted files to formData
decryptedFiles.forEach((file, index) => {
formData.set(`fileInput`, file);
formData.append(`fileInput`, file);
});
}

View File

@ -51,15 +51,11 @@
<br>
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{imageToPDF.submit}"></button>
<script>
$('#fileInput-input').on('change', function() {
$('#fileInput-input').on('file-input-change', () => {
var files = document.getElementById("fileInput-input").files;
var conversionType = document.getElementById("conversionType");
console.log("files.length=" + files.length)
if (files.length > 1) {
conversionType.disabled = false;
} else {
conversionType.disabled = true;
}
conversionType.disabled = files.length <= 1;
});
$('#conversionType').change(function() {