Created
January 21, 2021 13:17
-
-
Save groupdocscloud/1df2935cb1e1ed7b84ba1f6a73f84777 to your computer and use it in GitHub Desktop.
Convert Excel Spreadsheet to PDF in Python
This file contains hidden or 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
# Convert Excel Spreadsheets XLS, XLSX to PDF in Python | |
# Set your APP KEY and APP SID obtained from dashboard.groupdocs.cloud | |
apiInstance = groupdocs_conversion_cloud.ConvertApi.from_keys(Common.app_sid, Common.app_key) | |
# Prepare convert settings | |
settings = groupdocs_conversion_cloud.ConvertSettings() | |
settings.file_path = "Resources/spreadsheet.xlsx" | |
settings.format = "pdf" | |
# Load Options and Output settings | |
loadOptions = groupdocs_conversion_cloud.SpreadsheetLoadOptions() | |
loadOptions.one_page_per_sheet = True | |
settings.load_options = loadOptions | |
settings.output_path = "converted" | |
# Convert the Spreadsheet to PDF | |
result = apiInstance.convert_document(groupdocs_conversion_cloud.ConvertDocumentRequest(settings)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment