public class AutotagPDFOperation extends Object implements Operation
Sample usage:
AutotagPDFOperation autotagPDFOperation = AutotagPDFOperation.createNew();
autotagPDFOperation.setInput(FileRef.createFromLocalFile("autotagPdfInput.pdf"));
Credentials credentials = Credentials.serviceAccountCredentialsBuilder().fromFile("pdfservices-api-credentials.json").build();
AutotagOutputFiles autotagOutputFiles = autotagPDFOperation.execute(ExecutionContext.create(credentials));
autotagOutputFiles.saveTaggedPDF("autotagPdfOutput.pdf");
| Modifier and Type | Method and Description |
|---|---|
static AutotagPDFOperation |
createNew()
Constructs a
AutotagPDFOperation instance. |
AutotagOutputFiles |
execute(ExecutionContext context)
Executes this operation synchronously using the supplied context and returns
AutotagOutputFiles instance for the tagged PDF and report file. |
void |
setInput(FileRef sourceFileRef)
Sets an input file.
|
void |
setOptions(AutotagPDFOptions autotagPDFOptions)
Sets the options for this operation.
|
public void setOptions(AutotagPDFOptions autotagPDFOptions)
AutotagPDFOptions for how to specify the
options.autotagPDFOptions - autotag PDF options; use null for default valuespublic static AutotagPDFOperation createNew()
AutotagPDFOperation instance.AutotagPDFOperation instancepublic void setInput(FileRef sourceFileRef)
sourceFileRef - an input filepublic AutotagOutputFiles execute(ExecutionContext context) throws ServiceApiException, IOException, ServiceUsageException
AutotagOutputFiles instance for the tagged PDF and report file.
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 operationAutotagOutputFiles.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 © 2022 Adobe. All rights reserved.