Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix img to pdf merge conversion type #2476

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/resources/static/js/downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down
8 changes: 2 additions & 6 deletions src/main/resources/templates/convert/img-to-pdf.html
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading