Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active October 12, 2021 14:17
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/b602d39a748d19d9a8bea05b56f83105 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/b602d39a748d19d9a8bea05b56f83105 to your computer and use it in GitHub Desktop.
Convert Excel to PDF on Linux
// Load Excel file
Workbook workbook = new Workbook("workbook.xlsx");
// Define PdfSaveOptions
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
// Set the compliance type
pdfSaveOptions.Compliance = PdfCompliance.PdfA1b;
// Convert Excel to PDF
workbook.Save("output.pdf", pdfSaveOptions);
// Load the Excel file
Workbook workbook = new Workbook("SampleExcel.xls");
// Save the document in PDF format
workbook.Save("outputPDF.pdf", SaveFormat.Pdf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment