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); NotesCommentsLayoutingOptions notesOptions = new NotesCommentsLayoutingOptions(); notesOptions.setNotesPosition(NotesPositions.BottomFull); opts.setSlidesLayoutOptions(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.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(); }
| Constructor and Description |
|---|
TiffOptions()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBwConversionMode()
Specifies the algorithm for converting a color image into a black and white image.
|
int |
getCompressionType()
Specifies the compression type.
|
long |
getDpiX()
Specifies the horizontal resolution in dots per inch.
|
long |
getDpiY()
Specifies the vertical resolution in dots per inch.
|
java.awt.Dimension |
getImageSize()
Specifies size of a generated TIFF image.
|
IInkOptions |
getInkOptions()
Provides options that control the look of Ink objects in exported document.
|
int |
getPixelFormat()
Specifies the pixel format for the generated images.
|
boolean |
getShowHiddenSlides()
Specifies whether the generated document should include hidden slides or not.
|
ISlidesLayoutOptions |
getSlidesLayoutOptions()
Gets or sets the mode in which slides are placed on the page when exporting a presentation
ISlidesLayoutOptions. |
void |
setBwConversionMode(int value)
Specifies the algorithm for converting a color image into a black and white image.
|
void |
setCompressionType(int value)
Specifies the compression type.
|
void |
setDpiX(long value)
Specifies the horizontal resolution in dots per inch.
|
void |
setDpiY(long value)
Specifies the vertical resolution in dots per inch.
|
void |
setImageSize(java.awt.Dimension value)
Specifies size of a generated TIFF image.
|
void |
setPixelFormat(int value)
Specifies the pixel format for the generated images.
|
void |
setShowHiddenSlides(boolean value)
Specifies whether the generated document should include hidden slides or not.
|
void |
setSlidesLayoutOptions(ISlidesLayoutOptions value)
Gets or sets the mode in which slides are placed on the page when exporting a presentation
ISlidesLayoutOptions. |
getDefaultRegularFont, getGradientStyle, getProgressCallback, getSkipJavaScriptLinks, getWarningCallback, setDefaultRegularFont, setGradientStyle, setProgressCallback, setSkipJavaScriptLinks, setWarningCallbackequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDefaultRegularFont, getGradientStyle, getProgressCallback, getSkipJavaScriptLinks, getWarningCallback, setDefaultRegularFont, setGradientStyle, setProgressCallback, setSkipJavaScriptLinks, setWarningCallbackpublic final IInkOptions getInkOptions()
Provides options that control the look of Ink objects in exported document.
Read-only IInkOptions
getInkOptions in interface ITiffOptionspublic final boolean getShowHiddenSlides()
Specifies whether the generated document should include hidden slides or not. Default is false.
getShowHiddenSlides in interface ITiffOptionspublic final void setShowHiddenSlides(boolean value)
Specifies whether the generated document should include hidden slides or not. Default is false.
setShowHiddenSlides in interface ITiffOptionspublic final java.awt.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 Dimension.
getImageSize in interface ITiffOptionspublic final void setImageSize(java.awt.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 Dimension.
setImageSize in interface ITiffOptionspublic final long getDpiX()
Specifies the horizontal resolution in dots per inch. Read/write long.
getDpiX in interface ITiffOptionspublic final void setDpiX(long value)
Specifies the horizontal resolution in dots per inch. Read/write long.
setDpiX in interface ITiffOptionspublic final long getDpiY()
Specifies the vertical resolution in dots per inch. Read/write long.
getDpiY in interface ITiffOptionspublic final void setDpiY(long value)
Specifies the vertical resolution in dots per inch. Read/write long.
setDpiY in interface ITiffOptionspublic final int getCompressionType()
Specifies the compression type.
Read/write TiffCompressionTypes.
getCompressionType in interface ITiffOptionspublic final void setCompressionType(int value)
Specifies the compression type.
Read/write TiffCompressionTypes.
setCompressionType in interface ITiffOptionspublic final int getPixelFormat()
Specifies the pixel format for the generated images.
Read/write ImagePixelFormat.
getPixelFormat in interface ITiffOptionspublic final void setPixelFormat(int value)
Specifies the pixel format for the generated images.
Read/write ImagePixelFormat.
setPixelFormat in interface ITiffOptionspublic 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(); }
getSlidesLayoutOptions in interface ITiffOptionspublic 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(); }
setSlidesLayoutOptions in interface ITiffOptionspublic 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()/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(); }
getBwConversionMode in interface ITiffOptionspublic 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()/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(); }
setBwConversionMode in interface ITiffOptionsCopyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.