public class CombineFilesOperation extends Object implements Operation
Sample Usage:
CombineFilesOperation combineFilesOperation = CombineFilesOperation.createNew();
combineFilesOperation.addInput(FileRef.createFromLocalFile("~/Documents/combinePdfInput1.pdf",
"application/pdf"));
combineFilesOperation.addInput(FileRef.createFromLocalFile("~/Documents/combinePdfInput2.pdf",
"application/pdf"));
FileRef result = combineFilesOperation.execute(ClientContext.createFromFile("dc-services-sdk-config.json"));
result.saveAs("output/CombineFilesOutput.pdf");
| Modifier and Type | Method and Description |
|---|---|
void |
addInput(FileRef sourceFileRef)
Specifies a PDF file (media type "application/pdf") to be combined with other files.
|
void |
addInput(FileRef sourceFileRef,
PageRanges pageRanges)
Specifies particular pages of a PDF file (media type "application/pdf") to be combined with other files.
|
static CombineFilesOperation |
createNew()
Constructs a
CombineFilesOperation instance. |
FileRef |
execute(ClientContext context)
Executes this operation synchronously using the supplied context and returns a new FileRef instance for the resulting file.
|
public static CombineFilesOperation createNew()
CombineFilesOperation instance.CombineFilesOperation instancepublic void addInput(FileRef sourceFileRef)
For adding particular pages of a PDF file, use addInput(FileRef, PageRanges).
sourceFileRef - a PDF file to be combinedpublic void addInput(FileRef sourceFileRef, PageRanges pageRanges)
For adding all the pages of the file, consider addInput(FileRef).
sourceFileRef - a PDF filepageRanges - page ranges of the PDF file to be combinedpublic FileRef execute(ClientContext context) throws ServiceApiException, IOException
The resulting file may be stored in the system temporary directory (per java.io.tmpdir System property).
See FileRef for how temporary resources are cleaned up.
execute in interface Operationcontext - the context in which to execute the operationServiceApiException - if an API call results in an error responseIOException - if there is an error in reading either the input source or the resulting fileCopyright © 2019 Adobe. All rights reserved.