com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class FileSpecification

  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable


    public final class FileSpecification
    extends Object
    implements com.aspose.ms.System.IDisposable

    Class representing embedded file.

    • Constructor Detail

      • FileSpecification

        public FileSpecification(com.aspose.pdf.engine.data.IPdfPrimitive specification)

        File specification

        Parameters:
        specification - IPdfPrimitive object
      • FileSpecification

        public FileSpecification(String file)

        Constructor for FileSpecification

        Parameters:
        file - File path.
      • FileSpecification

        public FileSpecification(com.aspose.ms.System.IO.Stream stream,
                         String name)

        Constructor for file specification.

        Parameters:
        stream - Stream containing data file.
        name - File specification.
      • FileSpecification

        public FileSpecification(InputStream stream,
                         String name)

        Constructor for file specification.

        Parameters:
        stream - Stream containing data file.
        name - File specification.
      • FileSpecification

        public FileSpecification(String file,
                         String description)

        Constructor for FileSpecification.

        Parameters:
        file - File path.
        description - File description.
      • FileSpecification

        public FileSpecification(com.aspose.ms.System.IO.Stream stream,
                         String name,
                         String description)

        Constructor for FileSpecification.

        Parameters:
        stream - Stream to be used in the document.
        name - A file specification string.
        description - File description.
      • FileSpecification

        public FileSpecification(InputStream stream,
                         String name,
                         String description)

        Constructor for FileSpecification.

        Parameters:
        stream - Stream to be used in the document.
        name - A file specification string.
        description - File description.
      • FileSpecification

        public FileSpecification(String fileName,
                         Annotation annot)

        Constructor for FileSpecification.

        Parameters:
        fileName - String object
        annot - Annotation object
      • FileSpecification

        public FileSpecification()

        Create new empty file specification.

    • Method Detail

      • getEncoding

        public int getEncoding()

        Gets encoding format. Possible values: Zip - file is compressed with ZIP, None - file is not compressed.

        Returns:
        int value
        See Also:
        FileEncoding
      • setEncoding

        public void setEncoding(int value)

        Sets encoding format. Possible values: Zip - file is compressed with ZIP, None - file is not compressed.

        Parameters:
        value - int value
        See Also:
        FileEncoding
      • isIncludeContents

        public boolean isIncludeContents()

        If true, contents of the file will be included in the file specification.

        Returns:
        boolean value
      • setIncludeContents

        public void setIncludeContents(boolean value)

        If true, contents of the file will be included in the file specification.

        Parameters:
        value - boolean value
      • getEngineDict

        public com.aspose.pdf.engine.data.IPdfDictionary getEngineDict()

        Pdf dictionary containing information about the file. Internal only

        Returns:
        IPdfDictionary object
      • getEngineObj

        public com.aspose.pdf.engine.data.IPdfObject getEngineObj()

        Internal only

        Returns:
        IPdfObject object
      • getDescription

        public String getDescription()

        Gets text associated with the file specification.

        Returns:
        String value
      • setDescription

        public void setDescription(String value)

        Sets text associated with the file specification.

        Parameters:
        value - String value
      • getStreamContents

        public InputStream getStreamContents()

        Gets contents of file as stream. Contents is not loaded into memory which allows to decrease memory usage. But this stream does not support positioning and Length property. If you need this features please use Contents property instead.

        Returns:
        InputStream object
      • getContentsInternal

        public com.aspose.ms.System.IO.Stream getContentsInternal()

        Gets contents file.

        Returns:
        Stream object
      • getContents

        public InputStream getContents()

        Gets contents file.

        Returns:
        InputStream object
      • setContents

        public void setContents(InputStream value)

        Sets contents file.

        Parameters:
        value - InputStream object
      • getParams

        public FileParams getParams()

        Gets file paramteres.

        Returns:
        FileParams object
      • setParams

        public void setParams(FileParams value)

        Sets file paramteres.

        Parameters:
        value - FileParams object
      • getMIMEType

        public String getMIMEType()

        Gets subtype of the embedded file

        Returns:
        string value
      • setMIMEType

        public void setMIMEType(String value)

        Sets MIMEType.

        Parameters:
        value - String value
      • getName

        public String getName()

        Gets file specification name.

        Returns:
        String value
      • setName

        public void setName(String value)

        Sets file specification name.

        Parameters:
        value - String value
      • getUnicodeName

        public String getUnicodeName()

        Gets file specification unicode name.

        Returns:
        String value
      • setUnicodeName

        public void setUnicodeName(String value)

        Sets file specification unicode name.

        Parameters:
        value - String value
      • getFileSystem

        public String getFileSystem()

        Gets name of the file system.

        Returns:
        String value
      • setFileSystem

        public void setFileSystem(String value)

        Sets name of the file system.

        Parameters:
        value - String value
      • dispose

        public void dispose()
        Disposes this object
        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable