Class RemoveProtectionJob
- java.lang.Object
-
- com.adobe.pdfservices.operation.PDFServicesJob
-
- com.adobe.pdfservices.operation.pdfjobs.jobs.RemoveProtectionJob
-
public class RemoveProtectionJob extends PDFServicesJob
A job that allows to remove password security from a PDF document.Sample Usage:
InputStream inputStream = new FileInputStream(new File("SOURCE_PATH")); Credentials credentials = new ServicePrincipalCredentials( System.getenv("PDF_SERVICES_CLIENT_ID"), System.getenv("PDF_SERVICES_CLIENT_SECRET")); PDFServices pdfServices = new PDFServices(credentials); Asset asset = pdfServices.upload(inputStream, PDFServicesMediaType.PDF.getMediaType()); RemoveProtectionParams removeProtectionParams = new RemoveProtectionParams("mypassword"); RemoveProtectionJob removeProtectionJob = new RemoveProtectionJob(asset, removeProtectionParams); String location = pdfServices.submit(removeProtectionJob); PDFServicesResponse<RemoveProtectionResult> pdfServicesResponse = pdfServices.getJobResult(location, RemoveProtectionResult.class); Asset resultAsset = pdfServicesResponse.getResult().getAsset(); StreamAsset streamAsset = pdfServices.getContent(resultAsset);
-
-
Constructor Summary
Constructors Constructor Description RemoveProtectionJob(Asset asset, RemoveProtectionParams removeProtectionParams)Constructs a newRemoveProtectionJobinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RemoveProtectionJobsetOutput(Asset asset)Sets the output asset for the job.
-
-
-
Constructor Detail
-
RemoveProtectionJob
public RemoveProtectionJob(Asset asset, RemoveProtectionParams removeProtectionParams)
Constructs a newRemoveProtectionJobinstance.- Parameters:
asset-Assetobject containing the input file; can not be null.removeProtectionParams-RemoveProtectionParamsobject containing the password for removing protection; can not be null.
-
-
Method Detail
-
setOutput
public RemoveProtectionJob setOutput(Asset asset)
Sets the output asset for the job.@noteExternal assets can be set as output only when input is external asset as well- Parameters:
asset-Assetobject representing the output asset; can not be null.- Returns:
RemoveProtectionJobinstance
-
-