Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
Commenter avatars come from Gravatar.
document.getElementById('uploadForm').addEventListener('submit', function (e) {
e.preventDefault();
let pdfFile = document.getElementById('pdfFile').files[0];
if (!pdfFile) {
alert("Please select a PDF file.");
return;
}
let formData = new FormData();
formData.append("file", pdfFile);
fetch('https://v2.convertapi.com/convert/pdf/to/docx?Secret=your-api-key', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
if (data && data.Files && data.Files.length > 0) {
let downloadUrl = data.Files[0].Url;
let downloadLink = document.getElementById('downloadLink');
downloadLink.href = downloadUrl;
downloadLink.style.display = 'block';
} else {
alert('Conversion failed.');
}
})
.catch(error => {
console.error('Error:', error);
alert('Error converting file.');
});
});
Comments
One response to “Hello world!”
Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
Commenter avatars come from Gravatar.