DocxToPdfConverter class
Leave feedback
On this page
Provides a simple API to convert Microsoft Word DOCX documents to PDF format using the GroupDocs.Conversion LowCode interface.
This converter is part of the LowCode API, which allows you to perform document conversions with minimal code and configuration.
Features:
- Convert DOCX files to PDF with high fidelity
- Support for password-protected DOCX documents
- Customize loading and conversion via
WordProcessingLoadOptions
andPdfConvertOptions
- Stream and file-based conversion support
Code Examples:
- C# examples: groupdocs-conversion-lowcode-examples-csharp
- VB.NET examples: groupdocs-conversion-lowcode-examples-vbnet
- F# examples: groupdocs-conversion-lowcode-examples-fsharp
See the LowCode developer guide for more details: https://docs.groupdocs.net/conversion/developer-guide/
public sealed class DocxToPdfConverter : Converter<WordProcessingLoadOptions, PdfConvertOptions>
name | description |
---|---|
DocxToPdfConverter(…) | Initializes a new instance of the DocxToPdfConverter class for converting DOCX documents to PDF. (2 constructors) |
Convert(…) | Converts the loaded DOCX document to PDF and saves it to the specified file path. (2 methods) |
Example - Basic conversion:
using GroupDocs.Conversion.LowCode;
// Load license keys
var publicKey = Environment.GetEnvironmentVariable("GD_PUBLIC_KEY");
var privateKey = Environment.GetEnvironmentVariable("GD_PRIVATE_KEY");
// Apply the license
License.Set(publicKey, privateKey);
// Create a converter for the DOCX file
var converter = new DocxToPdfConverter("business-plan.docx");
// Convert DOCX to PDF
converter.Convert("business-plan.pdf");
Example - Advanced conversion with options:
var converter = new DocxToPdfConverter("protected.docx", options =>
{
options.Password = "12345";
options.HideWordTrackedChanges = true;
});
converter.Convert("converted.pdf", convertOptions =>
{
convertOptions.Pages = new List<int> { 1, 2, 3 };
convertOptions.Dpi = 300;
});
- namespace GroupDocs.Conversion.LowCode
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.