Packages

 

com.aspose.imaging.imageoptions

Class MultiPageOptions

  • Direct Known Subclasses:
    DjvuMultiPageOptions


    public class MultiPageOptions
    extends Object

    Base class for multiple pages supported formats

    • Constructor Detail

      • MultiPageOptions

        public MultiPageOptions()

        Initializes a new instance of the MultiPageOptions class.

      • MultiPageOptions

        public MultiPageOptions(int[] pages)

        Initializes a new instance of the MultiPageOptions class.

        Parameters:
        pages - The pages.
      • MultiPageOptions

        public MultiPageOptions(int[] pages,
                                Rectangle exportArea)

        Initializes a new instance of the MultiPageOptions class.

        Parameters:
        pages - The array of pages.
        exportArea - The export area.
      • MultiPageOptions

        public MultiPageOptions(String[] pageTitles)

        Initializes a new instance of the MultiPageOptions class.

        Parameters:
        pageTitles - The page titles.
      • MultiPageOptions

        public MultiPageOptions(String[] pageTitles,
                                Rectangle exportArea)

        Initializes a new instance of the MultiPageOptions class.

        Parameters:
        pageTitles - The page titles.
        exportArea - The export area.
      • MultiPageOptions

        public MultiPageOptions(IntRange[] ranges)

        Initializes a new instance of the MultiPageOptions class.

        Parameters:
        ranges - The IntRange.
      • MultiPageOptions

        public MultiPageOptions(IntRange[] ranges,
                                Rectangle exportArea)

        Initializes a new instance of the MultiPageOptions class.

        Parameters:
        ranges - The IntRange.
        exportArea - The export area.
      • MultiPageOptions

        public MultiPageOptions(IntRange range)

        Initializes a new instance of the MultiPageOptions class.

        Parameters:
        range - The IntRange.
      • MultiPageOptions

        public MultiPageOptions(IntRange range,
                                Rectangle exportArea)

        Initializes a new instance of the MultiPageOptions class.

        Parameters:
        range - The IntRange.
        exportArea - The export area.
      • MultiPageOptions

        public MultiPageOptions(int page)

        Initializes a new instance of the MultiPageOptions class.

        Parameters:
        page - The page index.
      • MultiPageOptions

        public MultiPageOptions(int page,
                                Rectangle exportArea)

        Initializes a new instance of the MultiPageOptions class.

        Parameters:
        page - The page index.
        exportArea - The export area.
    • Method Detail

      • getPages

        public int[] getPages()

        Gets or sets the pages.

        Value: The pages.
      • setPages

        public void setPages(int[] value)

        Gets or sets the pages.

        Value: The pages.
        Code example:

        This example shows how to convert a multi-page DJVU image to a multi-frame TIFF image.


        String dir = "c:\\temp\\";
        
        // Load a DJVU image from a file stream.
        java.io.FileInputStream stream = new java.io.FileInputStream(dir + "sample.djvu");
        try {
            com.aspose.imaging.fileformats.djvu.DjvuImage djvuImage = new com.aspose.imaging.fileformats.djvu.DjvuImage(stream);
            try {
                com.aspose.imaging.imageoptions.TiffOptions saveOptions = new com.aspose.imaging.imageoptions.TiffOptions(com.aspose.imaging.fileformats.tiff.enums.TiffExpectedFormat.Default);
                saveOptions.setCompression(com.aspose.imaging.fileformats.tiff.enums.TiffCompressions.Deflate);
        
                // Note that if the image is colorful, it will be automatically converted to B/W format according to the option below:
                saveOptions.setBitsPerSample(new int[]{1});
        
                saveOptions.setMultiPageOptions(new com.aspose.imaging.imageoptions.DjvuMultiPageOptions());
        
                // By default, all pages will be stored to the output TIFF, but the desired set of pages can be specified explicitly.
                // Only the first and the second page will be exported.
                saveOptions.getMultiPageOptions().setPages(new int[]{0, 1});
        
                // Set page titles.
                saveOptions.getMultiPageOptions().setPageTitles(new String[]{"The First Page", "The Second Page"});
        
                // Save to TIFF
                djvuImage.save(dir + "sample.tif", saveOptions);
            } finally {
                djvuImage.dispose();
            }
        } finally {
            stream.close();
        }
        

      • getPageTitles

        public String[] getPageTitles()

        Gets or sets the page titles.

        Value: The page titles.
      • setPageTitles

        public void setPageTitles(String[] value)

        Gets or sets the page titles.

        Value: The page titles.
        Code example:

        This example shows how to convert a multi-page DJVU image to a multi-frame TIFF image.


        String dir = "c:\\temp\\";
        
        // Load a DJVU image from a file stream.
        java.io.FileInputStream stream = new java.io.FileInputStream(dir + "sample.djvu");
        try {
            com.aspose.imaging.fileformats.djvu.DjvuImage djvuImage = new com.aspose.imaging.fileformats.djvu.DjvuImage(stream);
            try {
                com.aspose.imaging.imageoptions.TiffOptions saveOptions = new com.aspose.imaging.imageoptions.TiffOptions(com.aspose.imaging.fileformats.tiff.enums.TiffExpectedFormat.Default);
                saveOptions.setCompression(com.aspose.imaging.fileformats.tiff.enums.TiffCompressions.Deflate);
        
                // Note that if the image is colorful, it will be automatically converted to B/W format according to the option below:
                saveOptions.setBitsPerSample(new int[]{1});
        
                saveOptions.setMultiPageOptions(new com.aspose.imaging.imageoptions.DjvuMultiPageOptions());
        
                // By default, all pages will be stored to the output TIFF, but the desired set of pages can be specified explicitly.
                // Only the first and the second page will be exported.
                saveOptions.getMultiPageOptions().setPages(new int[]{0, 1});
        
                // Set page titles.
                saveOptions.getMultiPageOptions().setPageTitles(new String[]{"The First Page", "The Second Page"});
        
                // Save to TIFF
                djvuImage.save(dir + "sample.tif", saveOptions);
            } finally {
                djvuImage.dispose();
            }
        } finally {
            stream.close();
        }
        

      • getTimeInterval

        public final TimeInterval getTimeInterval()

        Gets the time interval.

        Value: The time interval.
        Returns:
        the time interval.
      • setTimeInterval

        public final void setTimeInterval(TimeInterval value)

        Sets the time interval.

        Value: The time interval.
        Parameters:
        value - the time interval.
      • getPageRasterizationOptions

        public final VectorRasterizationOptions[] getPageRasterizationOptions()

        Gets the page rasterization options.

        Returns:
        the page rasterization options.
      • setPageRasterizationOptions

        public final void setPageRasterizationOptions(VectorRasterizationOptions[] value)

        Sets the page rasterization options.

        Parameters:
        value - the page rasterization options.
      • getExportArea

        public Rectangle getExportArea()

        Gets or sets the export area.

        Value: The export area.
      • setExportArea

        public void setExportArea(Rectangle value)

        Gets or sets the export area.

        Value: The export area.
      • getMode

        public int getMode()

        Gets or sets the mode.

        Value: The mode.
      • setMode

        public void setMode(int value)

        Gets or sets the mode.

        Value: The mode.
      • getOutputLayersNames

        public String[] getOutputLayersNames()

        Gets or sets the output layers names(Works if export format supports layers naming, for example for Psd)

        Value: The output layers names.
      • setOutputLayersNames

        public void setOutputLayersNames(String[] value)

        Gets or sets the output layers names(Works if export format supports layers naming, for example for Psd)

        Value: The output layers names.
      • getMergeLayers

        public final boolean getMergeLayers()

        Gets a value indicating whether [merege layers].

        Value: true if [merege layers]; otherwise, false.
        Returns:
        a value indicating whether [merege layers].
      • setMergeLayers

        public final void setMergeLayers(boolean value)

        Sets a value indicating whether [merege layers].

        Value: true if [merege layers]; otherwise, false.
        Parameters:
        value - a value indicating whether [merege layers].
      • initPages

        public void initPages(IntRange[] ranges)

        Initializes the pages from ranges array

        Parameters:
        ranges - The ranges.