public class PDFPropertiesOperation extends Object implements Operation
Sample Usage:
PDFPropertiesOperation pdfPropertiesOperation = PDFPropertiesOperation.createNew();
FileRef source = FileRef.createFromLocalFile("src/test/resources/pdfPropertiesOperationInput.pdf");
pdfPropertiesOperation.setInputFile(source);
JSONObject result = pdfPropertiesOperation.execute(executionContext);
Modifier and Type | Method and Description |
---|---|
static PDFPropertiesOperation |
createNew()
Constructs a
PDFPropertiesOperation instance. |
org.json.JSONObject |
execute(ExecutionContext context)
Executes this operation synchronously using the supplied context and returns a new JSONObject instance for the resulting JSON object.
|
FileRef |
executeAndReturnFileRef(ExecutionContext context)
Executes this operation synchronously using the supplied context and returns a new FileRef instance for the resulting JSON file.
|
void |
setInputFile(FileRef sourceFileRef)
Sets an input file.
|
void |
setOptions(PDFPropertiesOptions pdfPropertiesOptions)
Sets the options for this operation.
|
public void setOptions(PDFPropertiesOptions pdfPropertiesOptions)
PDFPropertiesOptions
for how to specify the
options for PDF Properties Operation.pdfPropertiesOptions
- optional parameters; use null for default valuespublic static PDFPropertiesOperation createNew()
PDFPropertiesOperation
instance.PDFPropertiesOperation
instancepublic void setInputFile(FileRef sourceFileRef)
sourceFileRef
- an input filepublic FileRef executeAndReturnFileRef(ExecutionContext context) throws ServiceApiException, IOException, ServiceUsageException
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.
context
- 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 JSON File Reference.ServiceUsageException
- if service usage limits have been reached or credentials quota has been exhausted.public org.json.JSONObject execute(ExecutionContext context) throws ServiceApiException, IOException, ServiceUsageException
execute
in interface Operation
context
- 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 JSON ObjectServiceUsageException
- if service usage limits have been reached or credentials quota has been exhausted.Copyright © 2022 Adobe. All rights reserved.