Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active May 8, 2024 01:51
Show Gist options
  • Save aspose-com-gists/7ed55369a45586ede9ddcd408ba204ab to your computer and use it in GitHub Desktop.
Save aspose-com-gists/7ed55369a45586ede9ddcd408ba204ab to your computer and use it in GitHub Desktop.
Convert XBRL to HTML in Python
# This code sample demonstrates how to convert an XBRL file to a PDF document.
import io
import aspose.cells
from aspose.cells import Workbook, FileFormatType, SaveFormat as CellsSaveFormat
from aspose.finance.xbrl import XbrlDocument, SaveOptions, SaveFormat as XbrlSaveFormat
# Load XBRL document
document = XbrlDocument("sample.xbrl")
# Set save options
saveOptions = SaveOptions()
saveOptions.save_format = XbrlSaveFormat.XLSX
# Save XBRL as XLSX
document.save("sample_out.xlsx", saveOptions)
# Open an Excel file
workbook = Workbook("sample_out.xlsx")
# Save the document in HTML format
workbook.save("output.html", CellsSaveFormat.HTML)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment