Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active April 23, 2024 05:04
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/178bc3fec13d83a9cd3503272220172d to your computer and use it in GitHub Desktop.
Save aspose-com-gists/178bc3fec13d83a9cd3503272220172d to your computer and use it in GitHub Desktop.
Excel to PDF conversion with Aspose.Cells for .NET
// Create and initialize an instance of Workbook
Workbook book = new Workbook(input);
// Create and initialize an instance of PdfSaveOptions
PdfSaveOptions saveOptions = new PdfSaveOptions();
// Set AllColumnsInOnePagePerSheet to true
saveOptions.AllColumnsInOnePagePerSheet = true;
// Save Workbook to PDF fromart by passing the object of PdfSaveOptions
book.Save("output.pdf", saveOptions);
// Load the file in Workbook object
Workbook workbook = new Workbook(input);
// Define PdfSaveOptions
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
// Set PDF creation time
options.CreatedTime = DateTime.Now;
// Save the file
workbook.Save("output.pdf", pdfSaveOptions);
// Load the file in Workbook object
Workbook workbook = new Workbook(input);
// Define PdfSaveOptions
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
// Set the compliance type
pdfSaveOptions.Compliance = PdfCompliance.PdfA1b;
// Save the file
workbook.Save("output.pdf", pdfSaveOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment