!DOCTYPE html>
DOC to PDF Converter | Professional Tool
const progressBar = document.getElementById('progressBar');
const progressText = document.getElementById('progressText');
const resultArea = document.getElementById('resultArea');
const downloadBtn = document.getElementById('downloadBtn');
// Upload area click event
uploadArea.addEventListener('click', () => {
fileInput.click();
});
// File input change event
fileInput.addEventListener('change', function() {
if (this.files.length > 0) {
const file = this.files[0];
const fileSizeInKB = Math.round(file.size / 1024);
fileName.textContent = file.name;
fileSize.textContent = `${fileSizeInKB} KB`;
fileInfo.classList.add('active');
uploadArea.classList.add('active');
convertBtn.disabled = false;
}
});
// Convert button click event
convertBtn.addEventListener('click', function() {
// Reset progress
progressBar.style.width = '0%';
progressText.textContent = '0%';
// Simulate conversion process
let progress = 0;
const interval = setInterval(() => {
progress += Math.random() * 10;
if (progress >= 100) {
progress = 100;
clearInterval(interval);
// Show result after a short delay
setTimeout(() => {
resultArea.classList.add('active');
}, 500);
}
progressBar.style.width = `${progress}%`;
progressText.textContent = `${Math.round(progress)}%`;
}, 200);
});
// Download button click event
downloadBtn.addEventListener('click', function() {
alert('In a real application, this would download your converted PDF file. This is a frontend demo.');
});
// Drag and drop functionality
uploadArea.addEventListener('dragover', function(e) {
e.preventDefault();
uploadArea.style.backgroundColor = 'rgba(76, 201, 240, 0.2)';
});
uploadArea.addEventListener('dragleave', function() {
uploadArea.style.backgroundColor = 'rgba(76, 201, 240, 0.05)';
});
uploadArea.addEventListener('drop', function(e) {
e.preventDefault();
uploadArea.style.backgroundColor = 'rgba(76, 201, 240, 0.05)';
if (e.dataTransfer.files.length > 0) {
fileInput.files = e.dataTransfer.files;
const event = new Event('change');
fileInput.dispatchEvent(event);
}
});
});
DOC to PDF Converter
Convert your documents to PDF format with professional quality
Upload DOC/DOCX File
Drag & drop your file here or click to browse
document.docx
0 KB
Conversion Progress
0%
Your file has been converted successfully!
Fast Conversion
Convert your documents to PDF in seconds with our optimized algorithm
Secure & Private
Your files are processed securely and deleted after conversion
Mobile Friendly
Works perfectly on all devices - desktop, tablet, and mobile
DOC to PDF Converter
Convert your documents to PDF format with professional quality
Upload DOC/DOCX File
Drag & drop your file here or click to browse
document.docx
0 KB
Conversion Progress
0%
Your file has been converted successfully!
Fast Conversion
Convert your documents to PDF in seconds with our optimized algorithm
Secure & Private
Your files are processed securely and deleted after conversion
Mobile Friendly
Works perfectly on all devices - desktop, tablet, and mobile