PDF Conversion Tools – हिंदी और English में PDF को JPEG, Word, Excel में बदलें
आज के Time में PDF फाइल्स का उपयोग लगभग हर क्षेत्र में किया जाता है, लेकिन कई बार हमें इन्हें दूसरे फॉर्मेट्स में बदलने की आवश्यकता पड़ती है। हमारा PDF Conversion Tool एक बेहतरीन समाधान प्रदान करता है जिससे आप आसानी से:
केवल कुछ क्लिक्स में बदल सकते हैं!
PDF से JPEG/इमेज (Convert PDF to JPEG/Image)
PDF से Word (Convert PDF to DOCX)
PDF से Excel (Convert PDF to XLSX)
PDF Conversion Tools
PDF Conversion Tools (कनवर्ज़न टूल्स)
`;
const converted = htmlDocx.asBlob(htmlContent, {
orientation: 'portrait',
margins: { top: 1000, right: 1000, bottom: 1000, left: 1000 }
});
prepareDownload(converted, 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'converted.docx');
statusText.textContent = 'Conversion to Word completed!';
} catch (error) {
console.error('Word conversion error:', error);
statusText.textContent = 'Error converting to Word: ' + error.message;
statusText.style.color = '#e74c3c';
}
}async function convertToExcel() {
try {
statusText.style.display = 'block';
statusText.textContent = 'Converting to Excel...';
statusText.style.color = '#3498db';
// Create a meaningful Excel file
const wb = XLSX.utils.book_new();
// Add text data
const textData = [
["PDF Conversion Report"],
[],
["Original File", currentFile.name],
["File Size", (currentFile.size / 1024).toFixed(2) + " KB"],
["Conversion Date", new Date().toLocaleString()],
["Page Count", totalPages],
[],
["Note:", "The PDF content is included as an image on the next sheet"]
];
const ws = XLSX.utils.aoa_to_sheet(textData);
// Add some styling through column widths
ws['!cols'] = [{wch: 25}, {wch: 40}];
// Add the worksheet to the workbook
XLSX.utils.book_append_sheet(wb, ws, "PDF Info");
// Add the image as a second sheet
const imageData = canvas.toDataURL("image/png").split(',')[1];
const ws2 = XLSX.utils.aoa_to_sheet([
["PDF Page Image"],
["", { t: 's', v: 'Image inserted below' }]
]);
// Add image to worksheet
if (wb.props) wb.props.Images = [];
const imageId = wb.props.Images.length;
wb.props.Images.push(imageData);
// Add image reference to cell
ws2['!images'] = ws2['!images'] || [];
ws2['!images'].push({
imageId: imageId,
range: { s: { r: 2, c: 0 }, e: { r: 5, c: 1 } }
});
XLSX.utils.book_append_sheet(wb, ws2, "PDF Image");
// Generate Excel file
const excelFile = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
prepareDownload(excelFile, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'converted.xlsx');
statusText.textContent = 'Conversion to Excel completed!';
} catch (error) {
console.error('Excel conversion error:', error);
statusText.textContent = 'Error converting to Excel: ' + error.message;
statusText.style.color = '#e74c3c';
}
}