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

XlsxToPdfConverter class

Provides a simple API to convert Microsoft Excel XLSX spreadsheets to PDF format using the GroupDocs.Conversion LowCode interface.

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

Features:

  • Convert XLSX files to PDF with high fidelity
  • Support for password-protected XLSX documents
  • Customize loading and conversion via SpreadsheetLoadOptions 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 XlsxToPdfConverter : Converter<SpreadsheetLoadOptions, PdfConvertOptions>

Public Members

namedescription
XlsxToPdfConverter(…)Initializes a new instance of the XlsxToPdfConverter class for converting XLSX spreadsheets to PDF. (2 constructors)
Convert(…)Converts the loaded XLSX 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 XLSX file
var converter = new XlsxToPdfConverter("spreadsheet.xlsx");

// Convert XLSX to PDF
converter.Convert("spreadsheet.pdf");

Example - Advanced conversion with options:

var converter = new XlsxToPdfConverter("protected.xlsx", options =>
{
    options.Password = "12345";
    options.WorksheetIndex = 1; // Convert second worksheet
});
converter.Convert("converted.pdf", convertOptions =>
{
    convertOptions.Dpi = 300;
    convertOptions.PageSize = PageSize.A4;
});

See Also