public class AutotagPDFOperation extends Object implements Operation
Sample usage:
AutotagPDFOperation autotagPDFOperation = AutotagPDFOperation.createNew();
autotagPDFOperation.setInput(FileRef.createFromLocalFile("autotagPdfInput.pdf"));
Credentials credentials = Credentials.servicePrincipalCredentialsBuilder()
.withClientId("PDF_SERVICES_CLIENT_ID")
.withClientSecret("PDF_SERVICES_CLIENT_SECRET")
.build();
AutotagPDFOutput autotagPDFOutput = autotagPDFOperation.execute(ExecutionContext.create(credentials));
autotagPDFOutput.getTaggedPDF().saveAs("autotagPdfOutput.pdf");
Modifier and Type | Method and Description |
---|---|
static AutotagPDFOperation |
createNew()
Constructs an
AutotagPDFOperation instance. |
AutotagPDFOutput |
execute(ExecutionContext context)
Executes this operation synchronously using the supplied context and returns
AutotagPDFOutput instance for the tagged PDF and report file. |
void |
setInput(FileRef sourceFileRef)
Sets an input file.
|
void |
setOptions(AutotagPDFOptions autotagPDFOptions)
Sets the parameters for this operation.
|
public void setOptions(AutotagPDFOptions autotagPDFOptions)
AutotagPDFOptions
for how to specify the
options.autotagPDFOptions
- optional parameterspublic static AutotagPDFOperation createNew()
AutotagPDFOperation
instance.AutotagPDFOperation
instancepublic void setInput(FileRef sourceFileRef)
sourceFileRef
- an input filepublic AutotagPDFOutput execute(ExecutionContext context) throws ServiceApiException, IOException, ServiceUsageException
AutotagPDFOutput
instance for the tagged PDF and report file.
The resulting file(s) 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 Operation
context
- the context in which to execute the operationAutotagPDFOutput
.ServiceApiException
- if an API call results in an error responseIOException
- if there is an error in reading either the input source or the resulting PDF and report fileServiceUsageException
- if service usage limits have been reached or credentials quota has been exhausted.Copyright © 2023 Adobe. All rights reserved.