Last active
March 31, 2021 08:07
-
-
Save conholdate-gists/232e09604ed755b11d02e1c025524ac3 to your computer and use it in GitHub Desktop.
Convert PDF to XLS or XLSX using GroupDocs.Conversion for .NET API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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