PdfSaveOptions.ImageType
PdfSaveOptions.ImageType property
Represents the image type when converting the chart and shape .
[Obsolete("Chart and Shape are always rendered as vector elements(e.g. point, line) for rendering quality.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public ImageFormat ImageType { get; set; }
Remarks
NOTE: This member is now obsolete. Instead, Chart and Shape are always rendered as vector elements(e.g. point, line) for rendering quality. This property will be removed 12 months later since June 2022. Aspose apologizes for any inconvenience you may have experienced.
Examples
namespace AsposeCellsExamples
{
using Aspose.Cells;
using Aspose.Cells.Drawing;
using Aspose.Cells.Rendering;
using System;
using System.Drawing.Imaging;
public class PdfSaveOptionsPropertyImageTypeDemo
{
public static void Run()
{
// Create a new workbook
Workbook workbook = new Workbook();
// Create a sample worksheet with some data
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Cells["A1"].Value = "Sample Data for PDF Export";
worksheet.Cells["A2"].Value = "Demonstrating ImageType Property";
try
{
// Create PDF save options
PdfSaveOptions saveOptions = new PdfSaveOptions();
// Display the default ImageType value
Console.WriteLine("Default ImageType: " + saveOptions.ImageType);
// Set a different ImageType value
saveOptions.ImageType = ImageFormat.Png;
Console.WriteLine("Updated ImageType: " + saveOptions.ImageType);
// Save the workbook as PDF with the specified ImageType
workbook.Save("ImageTypeDemo.pdf", saveOptions);
Console.WriteLine("PDF saved with ImageType setting applied.");
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
}
See Also
- class PdfSaveOptions
- namespace Aspose.Cells
- assembly Aspose.Cells