Excel in PDF mit Standard oder Minimalgröße speichern
Standardmäßig speichert Aspose.Cells Excel in PDF mit Standardgröße. Sie können es jedoch auch mit Minimalgröße speichern, indem Sie die PdfSaveOptions.OptimizationType-Eigenschaft verwenden. Es akzeptiert die folgenden Werte
- PdfOptimizationType.Standard
- PdfOptimizationType.MinimumSize
Speichern Sie Excel in PDF mit Standard- oder Minimalgröße mithilfe von Aspose.Cells
Im folgenden Beispielcode wird gezeigt, wie Sie Excel mit Standard- oder Mindestgröße unter Verwendung der PdfSaveOptions.OptimizationType-Eigenschaft in PDF speichern können.
// 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); |