DjvuPage

Inheritance: java.lang.Object, com.aspose.imaging.DisposableObject, com.aspose.imaging.DataStreamSupporter, com.aspose.imaging.Image, com.aspose.imaging.RasterImage, com.aspose.imaging.RasterCachedImage

public class DjvuPage extends RasterCachedImage

Djvu page class

Fields

FieldDescription
PageExportedActionOccurs when [page exported action].
PropertyChangedOccurs when a property value changes.

Methods

MethodDescription
getBitsPerPixel()Gets the image bits per pixel count.
getParentImage()Gets the parent image the page belongs to
getWidth()Gets the width of the page
getHeight()Gets the height of the page
getImage()Gets the image.
getThumbnailImage()Gets or sets the thumbnail image for the page
setThumbnailImage(DjvuRaster value)Gets or sets the thumbnail image for the page
getPageNumber()Gets the page number.
isColor()Gets a value indicating whether this instance is color.
getTextForLocation(Rectangle rect)Gets the text for the rectangle location
getForegroundImage()Gets the foreground image for the page
getForegroundImage(int subsample)Gets the foreground image for the page
getTextImage()Gets the text image.
getTextImage(int subsample)Gets the text image.
getBackgroundImage()Gets the background image.
extractThumbnailImage()Extracts the thumbnail image from the Djvu page.

PageExportedAction

public static final DefEvent<OnPageExportedAction> PageExportedAction

Occurs when [page exported action].

PropertyChanged

public final StdEvent<System.ComponentModel.PropertyChangedEventArgs> PropertyChanged

Occurs when a property value changes.

getBitsPerPixel()

public int getBitsPerPixel()

Gets the image bits per pixel count.

Value: The image bits per pixel count.

Returns: int

getParentImage()

public DjvuImage getParentImage()

Gets the parent image the page belongs to

Value: The document.

Returns: DjvuImage

getWidth()

public int getWidth()

Gets the width of the page

Value: The width.

Returns: int

getHeight()

public int getHeight()

Gets the height of the page

Value: The height.

Returns: int

getImage()

public DjvuRaster getImage()

Gets the image.

Value: The image.

Returns: DjvuRaster

getThumbnailImage()

public DjvuRaster getThumbnailImage()

Gets or sets the thumbnail image for the page

Value: The thumbnail image.

Returns: DjvuRaster

setThumbnailImage(DjvuRaster value)

public void setThumbnailImage(DjvuRaster value)

Gets or sets the thumbnail image for the page

Value: The thumbnail image.

Parameters:

ParameterTypeDescription
valueDjvuRaster

getPageNumber()

public int getPageNumber()

Gets the page number.

Value: The page number.

Returns: int

Example: This example shows how to load a DJVU image from a file stream and print information about the pages.

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 {
        System.out.println("The total number of pages: " + djvuImage.getPages().length);
        System.out.println("The active page number:    " + djvuImage.getActivePage().getPageNumber());
        System.out.println("The first page number:     " + djvuImage.getFirstPage().getPageNumber());
        System.out.println("The last page number:      " + djvuImage.getLastPage().getPageNumber());

        for (com.aspose.imaging.fileformats.djvu.DjvuPage djvuPage : djvuImage.getPages()) {
            System.out.println("--------------------------------------------------");
            System.out.println("Page number:     " + djvuPage.getPageNumber());
            System.out.println("Page size:       " + djvuPage.getSize());
            System.out.println("Page raw format: " + djvuPage.getRawDataFormat());
        }
    } finally {
        djvuImage.dispose();
    }
} finally {
    stream.close();
}

//The output may look like this:
//The total number of pages: 2
//The active page number:    1
//The first page number:     1
//The last page number:      2
//--------------------------------------------------
//Page number:     1
//Page size:       { Width = 2481, Height = 3508}
//Page raw format: RgbIndexed1Bpp, used channels: 1
//--------------------------------------------------
//Page number:     2
//Page size:       { Width = 2481, Height = 3508}
//Page raw format: RgbIndexed1Bpp, used channels: 1

isColor()

public boolean isColor()

Gets a value indicating whether this instance is color.

Value: true if this instance is color; otherwise, false.

Returns: boolean

getTextForLocation(Rectangle rect)

public String getTextForLocation(Rectangle rect)

Gets the text for the rectangle location

Parameters:

ParameterTypeDescription
rectRectangleThe location rect.

Returns: java.lang.String - Text found on location

getForegroundImage()

public DjvuRaster getForegroundImage()

Gets the foreground image for the page

Returns: DjvuRaster - Bitmap image

getForegroundImage(int subsample)

public DjvuRaster getForegroundImage(int subsample)

Gets the foreground image for the page

Parameters:

ParameterTypeDescription
subsampleintThe subsample.

Returns: DjvuRaster - Bitmap image

getTextImage()

public DjvuRaster getTextImage()

Gets the text image.

Returns: DjvuRaster - The bitmap

getTextImage(int subsample)

public DjvuRaster getTextImage(int subsample)

Gets the text image.

Parameters:

ParameterTypeDescription
subsampleintThe subsample.

Returns: DjvuRaster - The bitmap

getBackgroundImage()

public DjvuRaster getBackgroundImage()

Gets the background image.

Returns: DjvuRaster - The bitmap

extractThumbnailImage()

public DjvuRaster extractThumbnailImage()

Extracts the thumbnail image from the Djvu page.

Returns: DjvuRaster - The Djvu raster image.