ComHelper

Inheritance: java.lang.Object

public class ComHelper

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.

Constructors

ConstructorDescription
ComHelper()

Methods

MethodDescription
openStream(InputStream input)Initialize and return new Document instance from the input stream.
openStream(InputStream input, String password)Initialize and return new Document instance from the input stream.
openStream(InputStream input, boolean isManagedStream)Initialize and return new Document instance from the input stream.
openStream(InputStream input, String password, boolean isManagedStream)Initialize and return new Document instance from the input stream.
openStream(InputStream input, LoadOptions options)Open and return an existing document from a stream providing necessary converting to get pdf document.
openFile(String filename)Just create and return Document using filename .
openFile(String filename, String password)Initialize and return new instance of the Document class for working with encrypted document.
openFile(String filename, String password, boolean isManagedStream)Initialize new instance of the Document class for working with encrypted document.
openFile(String filename, LoadOptions options)Open an existing document from a file providing necessary converting oprions to get pdf document.

ComHelper()

public ComHelper()

openStream(InputStream input)

public Document openStream(InputStream input)

Initialize and return new Document instance from the input stream.

Parameters:

ParameterTypeDescription
inputjava.io.InputStreamStream with pdf document.

Returns: Document - Document object

openStream(InputStream input, String password)

public Document openStream(InputStream input, String password)

Initialize and return new Document instance from the input stream.

Parameters:

ParameterTypeDescription
inputjava.io.InputStreamInput stream object, corresponding pdf is password protected.
passwordjava.lang.StringUser or owner password.

Returns: Document - Document object

openStream(InputStream input, boolean isManagedStream)

public Document openStream(InputStream input, boolean isManagedStream)

Initialize and return new Document instance from the input stream.

Parameters:

ParameterTypeDescription
inputjava.io.InputStreamStream with pdf document.
isManagedStreambooleanif set to true inner stream is closed before exit; otherwise, is not.

Returns: Document - Document object

openStream(InputStream input, String password, boolean isManagedStream)

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

Initialize and return new Document instance from the input stream.

Parameters:

ParameterTypeDescription
inputjava.io.InputStreamStream with pdf document.
passwordjava.lang.StringUser or owner password.
isManagedStreambooleanif set to true inner stream is closed before exit; otherwise, is not.

Returns: Document - Document object

openStream(InputStream input, LoadOptions options)

public Document openStream(InputStream input, LoadOptions options)

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

Parameters:

ParameterTypeDescription
inputjava.io.InputStreamInput stream to convert into pdf document.
optionsLoadOptionsRepresents properties for converting input into pdf document.

Returns: Document - Document object

openFile(String filename)

public Document openFile(String filename)

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

Parameters:

ParameterTypeDescription
filenamejava.lang.StringThe name of the pdf document file.

Returns: Document - Document object

openFile(String filename, String password)

public Document openFile(String filename, String password)

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

Parameters:

ParameterTypeDescription
filenamejava.lang.StringDocument file name.
passwordjava.lang.StringUser or owner password.

Returns: Document - Document object

openFile(String filename, String password, boolean isManagedStream)

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

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

Parameters:

ParameterTypeDescription
filenamejava.lang.StringDocument file name.
passwordjava.lang.StringUser or owner password.
isManagedStreambooleanif set to true inner stream is closed before exit; otherwise, is not.

Returns: Document - Document object

openFile(String filename, LoadOptions options)

public Document openFile(String filename, LoadOptions options)

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

Parameters:

ParameterTypeDescription
filenamejava.lang.StringInput file to convert into pdf document.
optionsLoadOptionsRepresents properties for converting filename into pdf document.

Returns: Document - Document object