public class Merger extends Object
Represents the main class that controls the document merging process.
| Constructor and Description |
|---|
Merger(InputStream document)
Initializes new instance of
Merger class. |
Merger(InputStream document,
ILoadOptions loadOptions)
Initializes new instance of
Merger class. |
Merger(InputStream document,
ILoadOptions loadOptions,
MergerSettings settings)
Initializes new instance of
Merger class. |
Merger(InputStream document,
MergerSettings settings)
Initializes new instance of
Merger class. |
Merger(String filePath)
Initializes new instance of
Merger class. |
Merger(String filePath,
ILoadOptions loadOptions)
Initializes new instance of
Merger class. |
Merger(String filePath,
ILoadOptions loadOptions,
MergerSettings settings)
Initializes new instance of
Merger class. |
Merger(String filePath,
MergerSettings settings)
Initializes new instance of
Merger class. |
| Modifier and Type | Method and Description |
|---|---|
void |
addPassword(IAddPasswordOptions addPasswordOptions)
Protects document with password.
|
void |
applyPageBuilder(com.groupdocs.merger.domain.builders.PageBuilder pageBuilder)
Applies page builder changes.
|
void |
changeOrientation(IOrientationOptions orientationOptions)
Applies a new orientation mode for the specified pages.
|
com.groupdocs.merger.domain.builders.PageBuilder |
createPageBuilder()
Creates a new Page builder with predefined document collection.
|
com.groupdocs.merger.domain.builders.PageBuilder |
createPageBuilder(com.groupdocs.merger.domain.options.PageBuilderOptions pageBuilderOptions)
Creates a new Page builder with predefined document collection.
|
void |
dispose()
Disposes resources.
|
void |
extractPages(IExtractOptions extractOptions)
Makes a new document with some pages from the source document.
|
void |
generatePreview(IPreviewOptions previewOptions)
Generates document pages preview.
|
IDocumentInfo |
getDocumentInfo()
Gets information about document pages: their sizes, maximum page height, the width of a page with the maximum height.
|
void |
importDocument(IImportDocumentOptions importDocumentOptions)
Imports the document as attachment or embedded via Ole.
|
boolean |
isPasswordSet()
Checks whether document is password protected.
|
void |
join(InputStream document)
Joins the documents into one single document.
|
void |
join(InputStream document,
IImageJoinOptions joinOptions)
Joins the documents into one single document.
|
void |
join(InputStream document,
IJoinOptions joinOptions)
Joins the documents into one single document.
|
void |
join(InputStream document,
com.groupdocs.merger.domain.options.interfaces.IPageJoinOptions joinOptions)
Joins the documents into one single document.
|
void |
join(String filePath)
Joins the documents into one single document.
|
void |
join(String filePath,
IImageJoinOptions joinOptions)
Joins the documents into one single document.
|
void |
join(String filePath,
IJoinOptions joinOptions)
Joins the documents into one single document.
|
void |
join(String filePath,
com.groupdocs.merger.domain.options.interfaces.IPageJoinOptions joinOptions)
Joins the documents into one single document.
|
void |
movePage(IMoveOptions moveOptions)
Moves page to a new position within document of known format.
|
void |
removePages(IRemoveOptions removeOptions)
Removes pages from document of known format.
|
void |
removePassword()
Removes password from document.
|
void |
rotatePages(IRotateOptions rotateOptions)
Rotate pages of the document.
|
void |
save(OutputStream document)
Saves the result document to the stream
document. |
void |
save(String filePath)
Saves the result document file to
filePath. |
void |
save(String filePath,
boolean useDefaultDirectory)
Saves the result document file to
filePath. |
void |
split(ISplitOptions splitOptions)
Splits the single document to the multiple documents.
|
void |
split(ITextSplitOptions splitOptions)
Splits the single document to the multiple documents.
|
void |
swapPages(ISwapOptions swapOptions)
Swaps two pages within document of known format.
|
void |
updatePassword(IUpdatePasswordOptions updatePasswordOptions)
Updates existing password for document.
|
public Merger(InputStream document) throws Exception
Initializes new instance of Merger class.
document - The readable stream.NullPointerException - Thrown when document is null.Exceptionpublic Merger(InputStream document, ILoadOptions loadOptions) throws Exception
Initializes new instance of Merger class.
document - The readable stream.loadOptions - The document load options.NullPointerException - Thrown when document is null.NullPointerException - Thrown when loadOptions is null.Exceptionpublic Merger(InputStream document, ILoadOptions loadOptions, MergerSettings settings) throws Exception
Initializes new instance of Merger class.
document - The readable stream.loadOptions - The document load options.settings - The Merger settings.NullPointerException - Thrown when document is null.NullPointerException - Thrown when loadOptions is null.NullPointerException - Thrown when settings is null.Exceptionpublic Merger(InputStream document, MergerSettings settings) throws Exception
Initializes new instance of Merger class.
document - The readable stream.settings - The Merger settings.NullPointerException - Thrown when document is null.NullPointerException - Thrown when settings is null.Exceptionpublic Merger(String filePath) throws Exception
Initializes new instance of Merger class.
filePath - The file path.NullPointerException - Thrown when filePath is null or empty.Exceptionpublic Merger(String filePath, ILoadOptions loadOptions) throws Exception
Initializes new instance of Merger class.
filePath - The file path.loadOptions - The document load options.NullPointerException - Thrown when filePath is null or empty.NullPointerException - Thrown when loadOptions is null.Exceptionpublic Merger(String filePath, ILoadOptions loadOptions, MergerSettings settings) throws Exception
Initializes new instance of Merger class.
filePath - The file path.loadOptions - The document load options.settings - The Merger settings.NullPointerException - Thrown when filePath is null or empty.NullPointerException - Thrown when loadOptions is null.NullPointerException - Thrown when settings is null.Exceptionpublic Merger(String filePath, MergerSettings settings) throws Exception
Initializes new instance of Merger class.
filePath - The file path.settings - The Merger settings.NullPointerException - Thrown when filePath is null or empty.NullPointerException - Thrown when settings is null.Exceptionpublic final void addPassword(IAddPasswordOptions addPasswordOptions) throws Exception
Protects document with password.
addPasswordOptions - The options for specifying the password.
NullPointerException - Thrown when addPasswordOptions is null.Exceptionpublic final void applyPageBuilder(com.groupdocs.merger.domain.builders.PageBuilder pageBuilder)
throws Exception
Applies page builder changes.
pageBuilder - The page builder.com.aspose.ms.System.ArgumentNullException - Thrown when pageBuilder is null.Exceptionpublic final void changeOrientation(IOrientationOptions orientationOptions) throws Exception
Applies a new orientation mode for the specified pages.
orientationOptions - The change orientation options.
NullPointerException - Thrown when orientationOptions is null.Exceptionpublic final com.groupdocs.merger.domain.builders.PageBuilder createPageBuilder()
throws Exception
Creates a new Page builder with predefined document collection.
Exceptionpublic final com.groupdocs.merger.domain.builders.PageBuilder createPageBuilder(com.groupdocs.merger.domain.options.PageBuilderOptions pageBuilderOptions)
throws Exception
Creates a new Page builder with predefined document collection.
Exceptionpublic final void dispose()
Disposes resources.
public final void extractPages(IExtractOptions extractOptions) throws Exception
Makes a new document with some pages from the source document.
extractOptions - The page options.
NullPointerException - Thrown when extractOptions is null.Exceptionpublic final void generatePreview(IPreviewOptions previewOptions) throws Exception
Generates document pages preview.
previewOptions - The preview options.
NullPointerException - Thrown when previewOptions is null.Exceptionpublic final IDocumentInfo getDocumentInfo() throws Exception
Gets information about document pages: their sizes, maximum page height, the width of a page with the maximum height.
Exceptionpublic final void importDocument(IImportDocumentOptions importDocumentOptions) throws Exception
Imports the document as attachment or embedded via Ole.
importDocumentOptions - The embedded document import options.
NullPointerException - Thrown when importDocumentOptions is null.Exceptionpublic final boolean isPasswordSet()
throws Exception
Checks whether document is password protected.
Exceptionpublic final void join(InputStream document) throws Exception
Joins the documents into one single document.
document - Joined document.
NullPointerException - Thrown when document is null.Exceptionpublic final void join(InputStream document, IImageJoinOptions joinOptions) throws Exception
Joins the documents into one single document.
document - Joined document.joinOptions - The image join options.
<b>Learn more</b>
com.aspose.ms.System.ArgumentNullException - Thrown when document is null.com.aspose.ms.System.ArgumentNullException - Thrown when joinOptions is null.Exceptionpublic final void join(InputStream document, IJoinOptions joinOptions) throws Exception
Joins the documents into one single document.
document - Joined document.joinOptions - The join options.
NullPointerException - Thrown when document is null.NullPointerException - Thrown when joinOptions is null.Exceptionpublic final void join(InputStream document, com.groupdocs.merger.domain.options.interfaces.IPageJoinOptions joinOptions) throws Exception
Joins the documents into one single document.
document - Joined document.joinOptions - The join options.
<b>Learn more</b>
com.aspose.ms.System.ArgumentNullException - Thrown when document is null.com.aspose.ms.System.ArgumentNullException - Thrown when joinOptions is null.Exceptionpublic final void join(String filePath) throws Exception
Joins the documents into one single document.
filePath - File path of the joined document.
NullPointerException - Thrown when filePath is null or empty.Exceptionpublic final void join(String filePath, IImageJoinOptions joinOptions) throws Exception
Joins the documents into one single document.
filePath - File path of the joined document.joinOptions - The image join options.
<b>Learn more</b>
com.aspose.ms.System.ArgumentNullException - Thrown when filePath is null or empty.com.aspose.ms.System.ArgumentNullException - Thrown when joinOptions is null.Exceptionpublic final void join(String filePath, IJoinOptions joinOptions) throws Exception
Joins the documents into one single document.
filePath - File path of the joined document.joinOptions - The join options.
NullPointerException - Thrown when filePath is null or empty.NullPointerException - Thrown when joinOptions is null.Exceptionpublic final void join(String filePath, com.groupdocs.merger.domain.options.interfaces.IPageJoinOptions joinOptions) throws Exception
Joins the documents into one single document.
filePath - File path of the joined document.joinOptions - The join options.
<b>Learn more</b>
com.aspose.ms.System.ArgumentNullException - Thrown when filePath is null or empty.com.aspose.ms.System.ArgumentNullException - Thrown when joinOptions is null.Exceptionpublic final void movePage(IMoveOptions moveOptions) throws Exception
Moves page to a new position within document of known format.
moveOptions - The move options.
NullPointerException - Thrown when moveOptions is null.Exceptionpublic final void removePages(IRemoveOptions removeOptions) throws Exception
Removes pages from document of known format.
removeOptions - The options for the numbers of pages to be removed.
NullPointerException - Thrown when removeOptions is null.Exceptionpublic final void removePassword()
throws Exception
Removes password from document.
Exceptionpublic final void rotatePages(IRotateOptions rotateOptions) throws Exception
Rotate pages of the document.
rotateOptions - The options for the page rotating.
NullPointerException - Thrown when rotateOptions is null.Exceptionpublic final void save(OutputStream document) throws Exception
Saves the result document to the stream document.
document - The document stream.NullPointerException - Thrown when document is null.Exceptionpublic final void save(String filePath) throws Exception
Saves the result document file to filePath.
filePath - The file name or full file path.NullPointerException - Thrown when filePath is null or empty.Exceptionpublic final void save(String filePath, boolean useDefaultDirectory) throws Exception
Saves the result document file to filePath.
filePath - The file path or name in case of default directory usage.useDefaultDirectory - Use the default directory from settings.NullPointerException - Thrown when filePath is null or empty.Exceptionpublic final void split(ISplitOptions splitOptions) throws Exception
Splits the single document to the multiple documents.
splitOptions - The page split options.
NullPointerException - Thrown when splitOptions is null.Exceptionpublic final void split(ITextSplitOptions splitOptions) throws Exception
Splits the single document to the multiple documents.
splitOptions - The text split options.
NullPointerException - Thrown when splitOptions is null.Exceptionpublic final void swapPages(ISwapOptions swapOptions) throws Exception
Swaps two pages within document of known format.
swapOptions - The swap options.
NullPointerException - Thrown when swapOptions is null.Exceptionpublic final void updatePassword(IUpdatePasswordOptions updatePasswordOptions) throws Exception
Updates existing password for document.
updatePasswordOptions - The options for specifying the current/new passwords.
NullPointerException - Thrown when updatePasswordOptions is null.ExceptionCopyright © 2024. All rights reserved.