Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active April 15, 2021 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/c119873f115a451030df2d9c9196f619 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/c119873f115a451030df2d9c9196f619 to your computer and use it in GitHub Desktop.
Convert PDF or Word file to Excel in C#
// Convert PDF document to Excel Spreadsheet in C#
using (Converter converter = new Converter("document.pdf"))
{
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions();
converter.Convert("outputpath/convertedSpreadsheet.xlsx", options);
}
// Convert second page of PDF file to Excel in C# with some options
using (Converter converter = new Converter("document.pdf"))
{
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions
{
PageNumber = 2,
PagesCount = 1,
Format = SpreadsheetFileType.Xlsx,
Zoom = 150
};
converter.Convert("outputpath/convertedSpreadsheet.xlsx", options);
}
// Convert Word document to Excel Spreadsheet in C#
using (Converter converter = new Converter("document.docx"))
{
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions();
converter.Convert("outputpath/convertedSpreadsheet.xlsx", options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment