Packages

 

com.aspose.imaging.fileformats.opendocument

Class OdgImage

  • All Implemented Interfaces:
    IObjectWithBounds, com.aspose.imaging_internal.fileformats.opendocument.IOdImage, com.aspose.ms.System.IDisposable, Closeable, AutoCloseable


    public class OdgImage
    extends OdImage

    The Open Document Graphic

    <inheritdoc></inheritdoc>
    Code example:

    This example loads a multi-page ODG image.


    String dir = "c:\\temp\\";
    
    // Using Aspose.Imaging.Image.Load is a unified way to load image.
    com.aspose.imaging.fileformats.opendocument.MultiPageImage image = (com.aspose.imaging.fileformats.opendocument.MultiPageImage) com.aspose.imaging.Image.load(dir + "sample.odg");
    try {
        // Cast to OdgImage
        com.aspose.imaging.fileformats.opendocument.OdgImage odgImage = (com.aspose.imaging.fileformats.opendocument.OdgImage) image;
    
        // Get all pages
        com.aspose.imaging.Image[] pages = odgImage.getPages();
    
        // Do some image processing
    } finally {
        image.dispose();
    }
    

    • Constructor Detail

      • OdgImage

        public OdgImage(InputStream stream)

        Initializes a new instance of the OdgImage class.

        Parameters:
        stream - The stream.
    • Method Detail

      • getFileFormat

        public long getFileFormat()

        Gets a value of file format

        Overrides:
        getFileFormat in class Image
        Returns:
        a value of file format
      • getPages

        public Image[] getPages()

        Gets the pages.

        Value: The pages.
        Specified by:
        getPages in class MultiPageImage
        Returns:
        the pages.