Packages

 

com.aspose.psd.fileformats.ai

Class AiImage

  • All Implemented Interfaces:
    IObjectWithBounds


    public final class AiImage
    extends Image

    The Adobe Illustrator (AI) Image

    See Also:
    Image
    Code example:

    A base example of converting an AI file to the PDF file format. It just loads an existing AI file and explicitly saves one as a PDF file.


                
    String inAiFilePath = "rect2_color.ai";
    String outPdfFilePath = "rect2_color.ai_output.pdf";
                
    // Load a regular AI file
    AiImage aiImage = (AiImage)Image.load(inAiFilePath);
    try
    {
        // Export the loaded AI file to the PDF file format with default options
        aiImage.save(outPdfFilePath, new PdfOptions());
    }
    finally
    {
        aiImage.dispose();
    }
    

    • Constructor Detail

      • AiImage

        public AiImage()
    • Method Detail

      • getLayers

        public final AiLayerSection[] getLayers()

        Gets the layer sections.

        Value: The layer sections.
      • getFileFormat

        public long getFileFormat()

        Gets a value of file format

        Overrides:
        getFileFormat in class Image
      • getVersion

        public final int getVersion()

        Gets the version of Adobe Illustrator format

        Value: The version.
      • setVersion

        public final void setVersion(int value)

        Gets the version of Adobe Illustrator format

        Value: The version.
      • getHeader

        public final AiHeader getHeader()

        Gets the header.

        Value: The header.
      • setHeader

        public final void setHeader(AiHeader value)

        Gets the header.

        Value: The header.
      • getSetupSection

        public final AiSetupSection getSetupSection()

        Gets the setup section.

        Value: The setup section.
      • setSetupSection

        public final void setSetupSection(AiSetupSection value)

        Gets the setup section.

        Value: The setup section.
      • getFinalizeSection

        public final AiFinalizeSection getFinalizeSection()

        Gets the finalize section.

        Value: The finalize section.
      • setFinalizeSection

        public final void setFinalizeSection(AiFinalizeSection value)

        Gets the finalize section.

        Value: The finalize section.
      • getDataSection

        public final AiDataSection getDataSection()

        Gets the data section.

        Value: The data section.
      • setDataSection

        public final void setDataSection(AiDataSection value)

        Gets the data section.

        Value: The data section.
      • isCached

        public boolean isCached()

        Gets a value indicating whether object's data is cached currently and no data reading is required.

        Value: true if object's data is cached; otherwise, false.
        Specified by:
        isCached in class DataStreamSupporter
        Returns:
        a value indicating whether object's data is cached currently and no data reading is required.
      • 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.
      • getWidth

        public int getWidth()

        Gets the image width.

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

        public int getHeight()

        Gets the image height.

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

        public void cacheData()

        Caches the data and ensures no additional data loading will be performed from the underlying P:Aspose.PSD.DataStreamSupporter.DataStreamContainer.

        Specified by:
        cacheData in class DataStreamSupporter
        Throws:
        com.aspose.ms.System.NotImplementedException - Not Implemented
      • resize

        public void resize(int newWidth,
                           int newHeight,
                           int resizeType)

        Resizes the image.

        Specified by:
        resize in class Image
        Parameters:
        newWidth - The new width.
        newHeight - The new height.
        resizeType - The resize type.
        Throws:
        com.aspose.ms.System.NotImplementedException - Not Implemented
      • resize

        public void resize(int newWidth,
                           int newHeight,
                           ImageResizeSettings settings)

        Resizes the image.

        Specified by:
        resize in class Image
        Parameters:
        newWidth - The new width.
        newHeight - The new height.
        settings - The resize settings.
        Throws:
        com.aspose.ms.System.NotImplementedException - Not Implemented
      • rotateFlip

        public void rotateFlip(int rotateFlipType)

        Rotates, flips, or rotates and flips the image.

        Specified by:
        rotateFlip in class Image
        Parameters:
        rotateFlipType - Type of the rotate flip.
        Throws:
        com.aspose.ms.System.NotImplementedException - Not Implemented
      • setPalette

        public void setPalette(IColorPalette palette,
                               boolean updateColors)

        Sets the image palette.

        Specified by:
        setPalette in class Image
        Parameters:
        palette - The palette to set.
        updateColors - if set to true colors will be updated according to the new palette; otherwise color indexes remain unchanged. Note that unchanged indexes may crash the image on loading if some indexes have no corresponding palette entries.
        Throws:
        com.aspose.ms.System.NotImplementedException - Not Implemented
      • addLayer

        public final void addLayer(AiLayerSection layer)

        Adds the AI layer section.

        Parameters:
        layer - The AI layer section.