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

XlsToPdfConverter class

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

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

Features:

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

Public Members

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

// Convert XLS to PDF
converter.Convert("legacy-spreadsheet.pdf");

Example - Advanced conversion with options:

var converter = new XlsToPdfConverter("protected.xls", options =>
{
    options.Password = "12345";
    options.WorksheetIndex = 1; // Convert second worksheet
    options.ShowHiddenSheets = true;
});
converter.Convert("converted.pdf", convertOptions =>
{
    convertOptions.Dpi = 300;
});

See Also