Class TiffOptions

Class TiffOptions

Namespace: Aspose.Slides.Export
Assembly: Aspose.Slides.dll (25.12.0)

Provides options that control how a presentation is saved in TIFF format.

[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
[Guid("2162fe38-d7a4-46ce-978c-ecedb7af54c0")]
public class TiffOptions : SaveOptions, ITiffOptions, ISaveOptions

Inheritance

object SaveOptions TiffOptions

Implements

ITiffOptions , ISaveOptions

Inherited Members

SaveOptions.WarningCallback , SaveOptions.ProgressCallback , SaveOptions.DefaultRegularFont , SaveOptions.GradientStyle , SaveOptions.SkipJavaScriptLinks

Examples

The following example shows how to convert PowerPoint to TIFF with default size.

// Instantiate a Presentation object that represents a presentation file
using (Presentation presentation = new Presentation("DemoFile.pptx"))
{
    // Saving the presentation to TIFF document
    presentation.Save("Tiffoutput_out.tiff", SaveFormat.Tiff);
}

The following example shows how to convert PowerPoint to TIFF with custom size.

// Instantiate a Presentation object that represents a Presentation file
using (Presentation pres = new Presentation("Convert_Tiff_Custom.pptx"))
{
    // Instantiate the TiffOptions class
    TiffOptions opts = new TiffOptions();
    // Setting compression type
    opts.CompressionType = TiffCompressionTypes.Default;
    NotesCommentsLayoutingOptions notesOptions = new NotesCommentsLayoutingOptions();
    notesOptions.NotesPosition = NotesPositions.BottomFull;
    opts.SlidesLayoutOption = notesOptions;
    // Compression Types
    // Default - Specifies the default compression scheme (LZW).
    // None - Specifies no compression.
    // CCITT3
    // CCITT4
    // LZW
    // RLE
    // Depth depends on the compression type and cannot be set manually.
    // Resolution unit  is always equal to “2” (dots per inch)
    // Setting image DPI
    opts.DpiX = 200;
    opts.DpiY = 100;
    // Set Image Size
    opts.ImageSize = new Size(1728, 1078);
    // Save the presentation to TIFF with specified image size
    pres.Save("TiffWithCustomSize_out.tiff", SaveFormat.Tiff, opts);
}

The following example shows how to convert PowerPoint to TIFF with custom image pixel format.

// Instantiate a Presentation object that represents a Presentation file
using (Presentation presentation = new Presentation("DemoFile.pptx"))
{
    TiffOptions options = new TiffOptions();
    options.PixelFormat = ImagePixelFormat.Format8bppIndexed;
    /*
    ImagePixelFormat contains the following values (as could be seen from documentation):
    Format1bppIndexed; // 1 bits per pixel, indexed.
    Format4bppIndexed; // 4 bits per pixel, indexed.
    Format8bppIndexed; // 8 bits per pixel, indexed.
    Format24bppRgb; // 24 bits per pixel, RGB.
    Format32bppArgb; // 32 bits per pixel, ARGB.
    */
    // Save the presentation to TIFF with specified image size
    presentation.Save("Tiff_With_Custom_Image_Pixel_Format_out.tiff", SaveFormat.Tiff, options);
}

Constructors

TiffOptions()

Default constructor.

public TiffOptions()

Properties

BwConversionMode

Specifies the algorithm for converting a color image into a black and white image. This option will applied only if Aspose.Slides.Export.TiffOptions.CompressionType is set to Aspose.Slides.Export.TiffCompressionTypes.CCITT4 or Aspose.Slides.Export.TiffCompressionTypes.CCITT3 Read/write Aspose.Slides.Export.BlackWhiteConversionMode. Default is Aspose.Slides.Export.BlackWhiteConversionMode.Default.

public BlackWhiteConversionMode BwConversionMode { get; set; }

Property Value

BlackWhiteConversionMode

Examples

TiffOptions tiffOptions = new TiffOptions();
tiffOptions.CompressionType = TiffCompressionTypes.CCITT4
tiffOptions.BwConversionMode = BlackWhiteConversionMode.Dithering;

using (var presentation = new Presentation())
{
    presentation.Save(tiffFilePath, SaveFormat.Tiff, tiffOptions);
}
Dim tiffOptions As New TiffOptions()
tiffOptions.CompressionType = TiffCompressionTypes.CCITT4
tiffOptions.BwConversionMode = BlackWhiteConversionMode.Dithering

Using presentation As New Presentation()
    presentation.Save(tiffFilePath, SaveFormat.Tiff, tiffOptions)
End Using

CompressionType

Specifies the compression type. Read/write Aspose.Slides.Export.TiffCompressionTypes.

public TiffCompressionTypes CompressionType { get; set; }

Property Value

TiffCompressionTypes

DpiX

Specifies the horizontal resolution in dots per inch. Read/write System.UInt32.

public uint DpiX { get; set; }

Property Value

uint

DpiY

Specifies the vertical resolution in dots per inch. Read/write System.UInt32.

public uint DpiY { get; set; }

Property Value

uint

ImageSize

Specifies size of a generated TIFF image. Default value is 0x0, what means that generated image sizes will be calculated based on presentation slide size value. Read/write System.Drawing.Size.

public Size ImageSize { get; set; }

Property Value

Size

InkOptions

Provides options that control the look of Ink objects in exported document. Read-only Aspose.Slides.Export.IInkOptions

public IInkOptions InkOptions { get; }

Property Value

IInkOptions

PixelFormat

Specifies the pixel format for the generated images. Read/write Aspose.Slides.Export.ImagePixelFormat.

public ImagePixelFormat PixelFormat { get; set; }

Property Value

ImagePixelFormat

ShowHiddenSlides

Specifies whether the generated document should include hidden slides or not. Default is false.

public bool ShowHiddenSlides { get; set; }

Property Value

bool

SlidesLayoutOptions

Gets or sets the mode in which slides are placed on the page when exporting a presentation Aspose.Slides.Export.ISlidesLayoutOptions.

public ISlidesLayoutOptions SlidesLayoutOptions { get; set; }

Property Value

ISlidesLayoutOptions

Examples

Example:

using (Presentation pres = new Presentation("pres.pptx"))
            {
                TiffOptions options = new TiffOptions
                {
                    SlidesLayoutOptions = new HandoutLayoutingOptions
                    {
                        Handout = HandoutType.Handouts4Horizontal
                    }
                };

                pres.Save("pres.tiff", SaveFormat.Tiff, options);
            }