TiffOptions

TiffOptions class

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

public class TiffOptions : SaveOptions, ITiffOptions

Constructors

NameDescription
TiffOptions()Default constructor.

Properties

NameDescription
BwConversionMode { get; set; }Specifies the algorithm for converting a color image into a black and white image. This option will applied only if CompressionType is set to CCITT4 or CCITT3 Read/write BlackWhiteConversionMode. Default is Default.
CompressionType { get; set; }Specifies the compression type. Read/write TiffCompressionTypes.
DefaultRegularFont { get; set; }Returns or sets font used in case source font is not found. Read-write String.
DpiX { get; set; }Specifies the horizontal resolution in dots per inch. Read/write UInt32.
DpiY { get; set; }Specifies the vertical resolution in dots per inch. Read/write UInt32.
GradientStyle { get; set; }Returns or sets the visual style of the gradient. Read/write GradientStyle.
ImageSize { get; set; }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 Size.
InkOptions { get; }Provides options that control the look of Ink objects in exported document. Read-only IInkOptions
PixelFormat { get; set; }Specifies the pixel format for the generated images. Read/write ImagePixelFormat.
ProgressCallback { get; set; }Represents a callback object for saving progress updates in percentage. See IProgressCallback.
ShowHiddenSlides { get; set; }Specifies whether the generated document should include hidden slides or not. Default is false.
SlidesLayoutOptions { get; set; }Gets or sets the mode in which slides are placed on the page when exporting a presentation ISlidesLayoutOptions.
WarningCallback { get; set; }Returns of sets an object which receives warnings and decides whether loading process will continue or will be aborted. Read/write IWarningCallback.

Examples

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

[C#]
// 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.

[C#]
// 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.

[C#]
// 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);
}

See Also