Related Article(s):
Last active
September 20, 2024 10:11
How to Convert Word to PDF using Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert the Word Document to PDF format using Node.js | |
// Load the source DOCX file | |
const converter = new groupdocs.conversion.Converter("sample.docx"); | |
// Set the convert options for PDF format | |
const options = new groupdocs.conversion.PdfConvertOptions(); | |
// Convert to PDF format | |
converter.convert("converted.pdf", options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert the specific pages of a Password Protected Word Document to PDF format using Node.js | |
const loadOptions = new groupdocs.conversion.WordProcessingLoadOptions() | |
loadOptions.setPassword("12345"); | |
const converter = new groupdocs.conversion.Converter('sample.docx') | |
const convertOptions = new groupdocs.conversion.PdfConvertOptions(); | |
convertOptions.setPageNumber(2); | |
convertOptions.setPagesCount(1); | |
// convertOptions.setRotate(groupdocs.conversion.Rotation.On180); | |
convertOptions.setDpi(300); | |
convertOptions.setWidth(1024); | |
convertOptions.setHeight(768); | |
converter.convert("converted.pdf", convertOptions); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment