Enregistrez Excel dans PDF avec une taille standard ou minimale
Contents
[
Hide
]
Par défaut, Aspose.Cells enregistre Excel dans PDF avec la taille standard. Cependant, vous pouvez également l’enregistrer avec la taille minimale en utilisant lePdfSaveOptions.OptimizationType la propriété. Il accepte les valeurs suivantes
- PdfOptimizationType.Standard
- PdfOptimizationType.MinimumSize
Enregistrez Excel dans PDF avec une taille standard ou minimale à l’aide de Aspose.Cells
L’exemple de code suivant montre comment vous pouvez enregistrer Excel dans PDF avec une taille standard ou minimale à l’aide dePdfSaveOptions.OptimizationTypela propriété.
This file contains 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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Load excel file into workbook object | |
Workbook workbook = new Workbook(dataDir + "SampleBook.xlsx"); | |
// Save into Pdf with Minimum size | |
PdfSaveOptions opts = new PdfSaveOptions(); | |
opts.OptimizationType = Aspose.Cells.Rendering.PdfOptimizationType.MinimumSize; | |
workbook.Save(dataDir + "OptimizedOutput_out.pdf", opts); |