com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class ComHelper



  • public class ComHelper
    extends Object

    Provides methods for COM clients to load a document into Aspose.PDF.


    Use the ComHelper class to load a document from a file or stream into a Document object in a COM application. The Document class provides a default constructor to create a new document and also provides overloaded constructors to load a document from a file or stream. If you are using Aspose.Words from a .NET application, you can use all of the Document constructors directly, but if you are using Aspose.PDF from a COM application, only the default Document constructor is available.

    • Constructor Detail

      • ComHelper

        public ComHelper()
    • Method Detail

      • openStream

        public Document openStream(InputStream input)

        Initialize and return new Document instance from the input stream.

        Parameters:
        input - Stream with pdf document.
        Returns:
        Document object
      • openStream

        public Document openStream(InputStream input,
                                   String password)

        Initialize and return new Document instance from the input stream.

        Parameters:
        input - Input stream object, corresponding pdf is password protected.
        password - User or owner password.
        Returns:
        Document object
      • openStream

        public Document openStream(InputStream input,
                                   boolean isManagedStream)

        Initialize and return new Document instance from the input stream.

        Parameters:
        input - Stream with pdf document.
        isManagedStream - if set to true inner stream is closed before exit; otherwise, is not.
        Returns:
        Document object
      • openStream

        public Document openStream(InputStream input,
                                   String password,
                                   boolean isManagedStream)

        Initialize and return new Document instance from the input stream.

        Parameters:
        input - Stream with pdf document.
        password - User or owner password.
        isManagedStream - if set to true inner stream is closed before exit; otherwise, is not.
        Returns:
        Document object
      • openStream

        public Document openStream(InputStream input,
                                   LoadOptions options)

        Open and return an existing document from a stream providing necessary converting to get pdf document.

        Parameters:
        input - Input stream to convert into pdf document.
        options - Represents properties for converting input into pdf document.
        Returns:
        Document object
      • openFile

        public Document openFile(String filename)

        Just create and return Document using filename. The same as Document(Stream).

        Parameters:
        filename - The name of the pdf document file.
        Returns:
        Document object
      • openFile

        public Document openFile(String filename,
                                 String password)

        Initialize and return new instance of the Document class for working with encrypted document.

        Parameters:
        filename - Document file name.
        password - User or owner password.
        Returns:
        Document object
      • openFile

        public Document openFile(String filename,
                                 String password,
                                 boolean isManagedStream)

        Initialize new instance of the Document class for working with encrypted document.

        Parameters:
        filename - Document file name.
        password - User or owner password.
        isManagedStream - if set to true inner stream is closed before exit; otherwise, is not.
        Returns:
        Document object
      • openFile

        public Document openFile(String filename,
                                 LoadOptions options)

        Open an existing document from a file providing necessary converting oprions to get pdf document.

        Parameters:
        filename - Input file to convert into pdf document.
        options - Represents properties for converting filename into pdf document.
        Returns:
        Document object