1. Home
  2. /
  3. GroupDocs.Conversion.LowCode
  4. /
  5. GroupDocs.Conversion.LowCode
  6. /
  7. DocxToPdfConverter

DocxToPdfConverter class

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 and PdfConvertOptions
  • Stream and file-based conversion support

Code Examples:

See the LowCode developer guide for more details: https://docs.groupdocs.net/conversion/developer-guide/

public sealed class DocxToPdfConverter : Converter<WordProcessingLoadOptions, PdfConvertOptions>

Public Members

namedescription
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)

Remarks

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;
});

See Also