Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Convert PDF to XLS or XLSX using GroupDocs.Conversion for .NET API
// PDF Load Options
GroupDocs.Conversion.Contracts.Func<LoadOptions> getLoadOptions = () => new PdfLoadOptions
{
FlattenAllFields = true, // all fields in the source document will be flatten during conversion
Password = "123" // provide password if document is password protected
};
// Excel Convert Options
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions
{
PageNumber = 1, // Starting page number
PagesCount = 1, // Total pages to convert
Format = SpreadsheetFileType.Xlsx, // Conversion format
Password = "password", // Set password for converted file
Zoom = 110 // Zoom level
};
// Convert PDF to XLSX
Converter converter = new Converter("C:\\Files\\sample.pdf", getLoadOptions);
converter.Convert("C:\\Files\\converted.xlsx", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment