Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created March 18, 2022 09:59
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 aspose-com-gists/15e45a549297be1e5e16493a240dd5ca to your computer and use it in GitHub Desktop.
Save aspose-com-gists/15e45a549297be1e5e16493a240dd5ca to your computer and use it in GitHub Desktop.
Convert XBRL to PDF using C#

Learn how to convert XBRL to PDF using C#.

The following topics are covered in this article:

  1. C# API to convert XBRL to PDF
  2. Convert XBRL to PDF
  3. Convert XML to PDF
// Load XBRL document
XbrlDocument document = new XbrlDocument(sourceDir + @"sample.xbrl");
// Set save options
Aspose.Finance.Xbrl.SaveOptions saveOptions = new Aspose.Finance.Xbrl.SaveOptions();
saveOptions.SaveFormat = Aspose.Finance.Xbrl.SaveFormat.XLSX;
// Save XBRL as XLSX in File Stream
FileStream fs = new FileStream("sample_out.xlsx", FileMode.Create);
document.Save(fs, saveOptions);
// Open an Excel file
Workbook workbook = new Workbook(fs);
// Save the document in PDF format
workbook.Save(outputDir + "sample_output.pdf", Aspose.Cells.SaveFormat.Pdf);
// Load XML document
XbrlDocument document = new XbrlDocument(sourceDir + @"sample.xml");
// Set save options
Aspose.Finance.Xbrl.SaveOptions saveOptions = new Aspose.Finance.Xbrl.SaveOptions();
saveOptions.SaveFormat = Aspose.Finance.Xbrl.SaveFormat.XLSX;
// Save XML as XLSX in File Stream
FileStream fs = new FileStream("sample_out.xlsx", FileMode.Create);
document.Save(fs, saveOptions);
// Open an Excel file
Workbook workbook = new Workbook(fs);
// Save the document in PDF format
workbook.Save(outputDir + "sample_output.pdf", Aspose.Cells.SaveFormat.Pdf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment