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

DocToPdfConverter class

Provides a simple API to convert Microsoft Word DOC documents to PDF format using the GroupDocs.Conversion LowCode interface.

This converter is part of the LowCode API, which allows you to perform DOC to PDF conversions with minimal code and configuration.

Features:

  • Convert DOC files to PDF with high fidelity
  • Support for password-protected DOC 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 DocToPdfConverter : Converter<WordProcessingLoadOptions, PdfConvertOptions>

Public Members

namedescription
DocToPdfConverter(…)Initializes a new instance of the DocToPdfConverter class for converting DOC documents to PDF. (2 constructors)
Convert(…)Converts the loaded DOC 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 DOC file
var converter = new DocToPdfConverter("legacy-document.doc");

// Convert DOC to PDF
converter.Convert("legacy-document.pdf");

Example - Advanced conversion with options:

var converter = new DocToPdfConverter("protected.doc", options =>
{
    options.Password = "12345";
    options.HideWordTrackedChanges = true;
    options.DefaultFont = "Arial";
});
converter.Convert("converted.pdf", convertOptions =>
{
    convertOptions.Dpi = 300;
});

See Also