TiffOptions

Inheritance: java.lang.Object, com.aspose.slides.SaveOptions

All Implemented Interfaces: com.aspose.slides.ITiffOptions

public class TiffOptions extends SaveOptions implements ITiffOptions

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


The following example shows how to convert PowerPoint to TIFF with default size.
 
 // Instantiate a Presentation object that represents a presentation file
 Presentation pres = new Presentation("DemoFile.pptx");
 try {
     // Saving the presentation to TIFF document
     pres.save("Tiffoutput_out.tiff", SaveFormat.Tiff);
 } finally {
     if (pres != null) pres.dispose();
 }
 
 The following example shows how to convert PowerPoint to TIFF with custom size.
 
 // Instantiate a Presentation object that represents a Presentation file
 Presentation pres = new Presentation("Convert_Tiff_Custom.pptx");
 try {
     // Instantiate the TiffOptions class
     TiffOptions opts = new TiffOptions();
     // Setting compression type
     opts.setCompressionType(TiffCompressionTypes.Default);
     INotesCommentsLayoutingOptions notesOptions = opts.getNotesCommentsLayouting();
     notesOptions.setNotesPosition(NotesPositions.BottomFull);
     // 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.setDpiX(200);
     opts.setDpiY(100);
     // Set Image Size
     opts.setImageSize(new Dimension(1728, 1078));
     // Save the presentation to TIFF with specified image size
     pres.save("TiffWithCustomSize_out.tiff", SaveFormat.Tiff, opts);
 } finally {
     if (pres != null) pres.dispose();
 }
 
 The following example shows how to convert PowerPoint to TIFF with custom image pixel format.
 
 // Instantiate a Presentation object that represents a Presentation file
 Presentation pres = new Presentation("DemoFile.pptx");
 try {
     TiffOptions options = new TiffOptions();
     options.setPixelFormat(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
     pres.save("Tiff_With_Custom_Image_Pixel_Format_out.tiff", SaveFormat.Tiff, options);
 } finally {
     if (pres != null) pres.dispose();
 }

Constructors

ConstructorDescription
TiffOptions()Default constructor.

Methods

MethodDescription
getInkOptions()Provides options that control the look of Ink objects in exported document.
getNotesCommentsLayouting()Provides options that control how notes and comments is placed in exported document.
getShowHiddenSlides()Specifies whether the generated document should include hidden slides or not.
setShowHiddenSlides(boolean value)Specifies whether the generated document should include hidden slides or not.
getImageSize()Specifies size of a generated TIFF image.
setImageSize(Dimension value)Specifies size of a generated TIFF image.
getDpiX()Specifies the horizontal resolution in dots per inch.
setDpiX(long value)Specifies the horizontal resolution in dots per inch.
getDpiY()Specifies the vertical resolution in dots per inch.
setDpiY(long value)Specifies the vertical resolution in dots per inch.
getCompressionType()Specifies the compression type.
setCompressionType(int value)Specifies the compression type.
getPixelFormat()Specifies the pixel format for the generated images.
setPixelFormat(int value)Specifies the pixel format for the generated images.
getSlidesLayoutOptions()Gets or sets the mode in which slides are placed on the page when exporting a presentation ISlidesLayoutOptions.
setSlidesLayoutOptions(ISlidesLayoutOptions value)Gets or sets the mode in which slides are placed on the page when exporting a presentation ISlidesLayoutOptions.
getBwConversionMode()Specifies the algorithm for converting a color image into a black and white image.
setBwConversionMode(int value)Specifies the algorithm for converting a color image into a black and white image.

TiffOptions()

public TiffOptions()

Default constructor.

getInkOptions()

public final IInkOptions getInkOptions()

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

Returns: IInkOptions

getNotesCommentsLayouting()

public final INotesCommentsLayoutingOptions getNotesCommentsLayouting()

Provides options that control how notes and comments is placed in exported document.

Returns: INotesCommentsLayoutingOptions

getShowHiddenSlides()

public final boolean getShowHiddenSlides()

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

Returns: boolean

setShowHiddenSlides(boolean value)

public final void setShowHiddenSlides(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

getImageSize()

public final Dimension getImageSize()

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 java.awt.Dimension.

Returns: java.awt.Dimension

setImageSize(Dimension value)

public final void setImageSize(Dimension value)

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 java.awt.Dimension.

Parameters:

ParameterTypeDescription
valuejava.awt.Dimension

getDpiX()

public final long getDpiX()

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

Returns: long

setDpiX(long value)

public final void setDpiX(long value)

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

Parameters:

ParameterTypeDescription
valuelong

getDpiY()

public final long getDpiY()

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

Returns: long

setDpiY(long value)

public final void setDpiY(long value)

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

Parameters:

ParameterTypeDescription
valuelong

getCompressionType()

public final int getCompressionType()

Specifies the compression type. Read/write TiffCompressionTypes.

Returns: int

setCompressionType(int value)

public final void setCompressionType(int value)

Specifies the compression type. Read/write TiffCompressionTypes.

Parameters:

ParameterTypeDescription
valueint

getPixelFormat()

public final int getPixelFormat()

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

Returns: int

setPixelFormat(int value)

public final void setPixelFormat(int value)

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

Parameters:

ParameterTypeDescription
valueint

getSlidesLayoutOptions()

public final ISlidesLayoutOptions getSlidesLayoutOptions()

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


Example:
 
 Presentation pres = new Presentation("pres.pptx");
 try {
     TiffOptions options = new TiffOptions();
     HandoutLayoutingOptions slidesLayoutOptions = new HandoutLayoutingOptions();
     slidesLayoutOptions.setHandout(HandoutType.Handouts4Horizontal);
     options.setSlidesLayoutOptions(slidesLayoutOptions);

     pres.save("pres.tiff", SaveFormat.Tiff, options);
 } finally {
     if (pres != null) pres.dispose();
 }

Returns: ISlidesLayoutOptions

setSlidesLayoutOptions(ISlidesLayoutOptions value)

public final void setSlidesLayoutOptions(ISlidesLayoutOptions value)

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


Example:
 
 Presentation pres = new Presentation("pres.pptx");
 try {
     TiffOptions options = new TiffOptions();
     HandoutLayoutingOptions slidesLayoutOptions = new HandoutLayoutingOptions();
     slidesLayoutOptions.setHandout(HandoutType.Handouts4Horizontal);
     options.setSlidesLayoutOptions(slidesLayoutOptions);

     pres.save("pres.tiff", SaveFormat.Tiff, options);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
valueISlidesLayoutOptions

getBwConversionMode()

public final int getBwConversionMode()

Specifies the algorithm for converting a color image into a black and white image. This option will applied only if CompressionType (#getCompressionType.getCompressionType/#setCompressionType(int).setCompressionType(int)) is set to TiffCompressionTypes.CCITT4 or TiffCompressionTypes.CCITT3 Read/write BlackWhiteConversionMode. Default is BlackWhiteConversionMode.Default.


TiffOptions tiffOptions = new TiffOptions();
 tiffOptions.setCompressionType(TiffCompressionTypes.CCITT4);
 tiffOptions.setBwConversionMode(BlackWhiteConversionMode.Dithering);
 Presentation presentation = new Presentation();
 try {
     presentation.save(tiffFilePath, SaveFormat.Tiff, tiffOptions);
 } finally {
     if (presentation != null) presentation.dispose();
 }

Returns: int

setBwConversionMode(int value)

public final void setBwConversionMode(int value)

Specifies the algorithm for converting a color image into a black and white image. This option will applied only if CompressionType (#getCompressionType.getCompressionType/#setCompressionType(int).setCompressionType(int)) is set to TiffCompressionTypes.CCITT4 or TiffCompressionTypes.CCITT3 Read/write BlackWhiteConversionMode. Default is BlackWhiteConversionMode.Default.


TiffOptions tiffOptions = new TiffOptions();
 tiffOptions.setCompressionType(TiffCompressionTypes.CCITT4);
 tiffOptions.setBwConversionMode(BlackWhiteConversionMode.Dithering);
 Presentation presentation = new Presentation();
 try {
     presentation.save(tiffFilePath, SaveFormat.Tiff, tiffOptions);
 } finally {
     if (presentation != null) presentation.dispose();
 }

Parameters:

ParameterTypeDescription
valueint