Packages

 

com.aspose.imaging.fileformats.djvu

Class DjvuPage

    • Field Detail

      • PageExportedAction

        public static final com.aspose.ms.lang.Event<OnPageExportedAction> PageExportedAction
      • PropertyChanged

        public final com.aspose.ms.lang.Event<com.aspose.ms.System.ComponentModel.PropertyChangedEventHandler> PropertyChanged
    • Constructor Detail

      • DjvuPage

        public DjvuPage()

        Initializes a new instance of the DjvuPage class.

    • Method Detail

      • getBitsPerPixel

        public int getBitsPerPixel()

        Gets the image bits per pixel count.

        Value: The image bits per pixel count.
        Specified by:
        getBitsPerPixel in class Image
        Returns:
        The image bits per pixel count.
      • getParentImage

        public DjvuImage getParentImage()

        Gets the parent image the page belongs to

        Value: The document.
      • getWidth

        public int getWidth()

        Gets the width of the page

        Value: The width.
        Specified by:
        getWidth in interface IObjectWithBounds
        Specified by:
        getWidth in class Image
        Returns:
        The image width.
      • getHeight

        public int getHeight()

        Gets the height of the page

        Value: The height.
        Specified by:
        getHeight in interface IObjectWithBounds
        Specified by:
        getHeight in class Image
        Returns:
        The image height.
      • getHeader

        public DirmComponent getHeader()

        Gets the header.

        Value: The header.
      • getImage

        public DjvuRaster getImage()

        Gets the image.

        Value: The image.
      • getThumbnailImage

        public DjvuRaster getThumbnailImage()

        Gets or sets the thumbnail image for the page

        Value: The thumbnail image.
      • setThumbnailImage

        public void setThumbnailImage(DjvuRaster value)

        Gets or sets the thumbnail image for the page

        Value: The thumbnail image.
      • getPageNumber

        public int getPageNumber()

        Gets the page number.

        Value: The page number.
        Code 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.
      • getTextForLocation

        public String getTextForLocation(Rectangle rect)

        Gets the text for the rectangle location

        Parameters:
        rect - The location rect.
        Returns:
        Text found on location
      • getForegroundImage

        public DjvuRaster getForegroundImage()

        Gets the foreground image for the page

        Returns:
        Bitmap image
      • getForegroundImage

        public DjvuRaster getForegroundImage(int subsample)

        Gets the foreground image for the page

        Parameters:
        subsample - The subsample.
        Returns:
        Bitmap image
      • getTextImage

        public DjvuRaster getTextImage()

        Gets the text image.

        Returns:
        The bitmap
      • getTextImage

        public DjvuRaster getTextImage(int subsample)

        Gets the text image.

        Parameters:
        subsample - The subsample.
        Returns:
        The bitmap
      • getBackgroundImage

        public DjvuRaster getBackgroundImage()

        Gets the background image.

        Returns:
        The bitmap
      • extractThumbnailImage

        public DjvuRaster extractThumbnailImage()

        Extracts the thumbnail image from the Djvu page.

        Returns:
        The Djvu raster image.