Show / Hide Table of Contents

Class RemoveProtectionJob

A job that allows to remove password security from a PDF document.

Inheritance
System.Object
PDFServicesJob
RemoveProtectionJob
Namespace: Adobe.PDFServicesSDK.pdfjobs.jobs
Assembly: Adobe.PDFServicesSDK.Doc.dll
Syntax
public class RemoveProtectionJob : PDFServicesJob
Examples

Sample Usage:

    using Stream inputStream = File.OpenRead("<SOURCE_PATH>");

    ICredentials credentials = new ServicePrincipalCredentials(
        Environment.GetEnvironmentVariable("PDF_SERVICES_CLIENT_ID"),
        Environment.GetEnvironmentVariable("PDF_SERVICES_CLIENT_SECRET"));

    PDFServices pdfServices = new PDFServices(credentials);

    IAsset asset = pdfServices.Upload(inputStream, PDFServicesMediaType.PDF.GetMIMETypeValue());

    RemoveProtectionParams removeProtectionParams = new RemoveProtectionParams("password");
    RemoveProtectionJob removeProtectionJob = new RemoveProtectionJob(asset, removeProtectionParams);
    String location = pdfServices.Submit(removeProtectionJob);
    PDFServicesResponse<RemoveProtectionResult> pdfServicesResponse =
        pdfServices.GetJobResult<RemoveProtectionResult>(location, typeof(RemoveProtectionResult));

    IAsset resultAsset = pdfServicesResponse.Result.Asset;
    StreamAsset streamAsset = pdfServices.GetContent(resultAsset);

Constructors

RemoveProtectionJob(IAsset, RemoveProtectionParams)

Constructs a new RemoveProtectionJob instance.

Declaration
public RemoveProtectionJob(IAsset asset, RemoveProtectionParams removeProtectionParams)
Parameters
Type Name Description
IAsset asset

The input IAsset for the job; can not be null.

RemoveProtectionParams removeProtectionParams

The input RemoveProtectionParams for the job; can not be null.

Methods

SetOutput(IAsset)

Sets the output asset for the job.

Declaration
public RemoveProtectionJob SetOutput(IAsset asset)
Parameters
Type Name Description
IAsset asset

IAsset object representing the output asset; can not be null.

Returns
Type Description
RemoveProtectionJob

AutotagPDFJob instance

Remarks

External assets can be set as output only when input is external asset as well

In This Article
  • Constructors
    • RemoveProtectionJob(IAsset, RemoveProtectionParams)
  • Methods
    • SetOutput(IAsset)
Back to top Copyright © 2020 Adobe. All rights reserved.