Show / Hide Table of Contents

Class PDFServices

This class is the entry point for all the PDF Service utilities. These utilities can be used to perform various functions such as submitting PDFServicesJob, getting status of a PDFServicesJob, getting result of a PDFServicesJob, uploading IAsset, getting content of an IAsset, deleting an IAsset and refreshing an IAsset.

Methods provided by the utility are:

  • Upload IAsset (or Assets)
  • Submit PDFServicesJob
  • Get status of a PDFServicesJob
  • Get result of a PDFServicesJob
  • Get content of IAsset
  • Delete IAsset
  • Refresh IAsset

Inheritance
System.Object
PDFServices
Namespace: Adobe.PDFServicesSDK
Assembly: Adobe.PDFServicesSDK.Doc.dll
Syntax
public class PDFServices

Constructors

PDFServices(ICredentials)

Constructs a PDFServices instance with the given ICredentials and ClientConfig.

Declaration
public PDFServices(ICredentials credentials)
Parameters
Type Name Description
ICredentials credentials

Credentials to be used for authentication; cannot be null.

PDFServices(ICredentials, ClientConfig)

Constructs a PDFServices instance with the given ICredentials and ClientConfig.

Declaration
public PDFServices(ICredentials credentials, ClientConfig clientConfig)
Parameters
Type Name Description
ICredentials credentials

Credentials to be used for authentication; cannot be null.

ClientConfig clientConfig

Client configuration for PDFServices; cannot be null.

Methods

DeleteAsset(IAsset)

Deletes an asset from PDF Services storage.

Declaration
public void DeleteAsset(IAsset asset)
Parameters
Type Name Description
IAsset asset

The IAsset to be deleted; cannot be null.

Exceptions
Type Condition
ServiceApiException

Thrown if an error is encountered while deleting the asset.

SDKException

Thrown for client-side or network errors.

GetContent(IAsset)

Returns the content of the asset.

Declaration
public StreamAsset GetContent(IAsset asset)
Parameters
Type Name Description
IAsset asset

The IAsset whose content is to be retrieved; cannot be null.

Returns
Type Description
StreamAsset

The StreamAsset containing the stream content along with the media type.

Exceptions
Type Condition
ServiceApiException

Thrown if an error is encountered while getting the content.

SDKException

Thrown for client-side or network errors.

GetJobResult<T>(String, Type)

Returns PDFServicesResponse for the submitted PDFServicesJob result.

Declaration
public PDFServicesResponse<T> GetJobResult<T>(string pollingURL, Type resultClass)
Parameters
Type Name Description
System.String pollingURL

URL to be polled to get the job result; cannot be null or empty.

System.Type resultClass

Result class for the job; cannot be null or empty.

Returns
Type Description
PDFServicesResponse<T>

PDFServicesResponse with the job result.

Type Parameters
Name Description
T

The result class for PDFServicesJob, it will be an implementation of IPDFServicesJobResult; cannot be null.

Exceptions
Type Condition
ServiceApiException

Thrown if an error is encountered while getting the job result.

SDKException

Thrown for client-side or network errors.

GetJobStatus(String)

Returns PDFServicesJobStatusResponse for the submitted PDFServicesJob.

Declaration
public PDFServicesJobStatusResponse GetJobStatus(string pollingURL)
Parameters
Type Name Description
System.String pollingURL

URL to be polled to get the job status; cannot be null or empty.

Returns
Type Description
PDFServicesJobStatusResponse

PDFServicesJobStatusResponse encapsulating the job status and retry interval.

Exceptions
Type Condition
ServiceApiException

Thrown if an error is encountered while getting the job status.

RefreshDownloadURI(IAsset)

Returns a new IAsset with a new valid download URI.

Declaration
public IAsset RefreshDownloadURI(IAsset asset)
Parameters
Type Name Description
IAsset asset

The IAsset to be refreshed; cannot be null.

Returns
Type Description
IAsset

The IAsset with a new valid download URI.

Exceptions
Type Condition
ServiceApiException

Thrown if an error is encountered while refreshing the asset.

SDKException

Thrown for client-side or network errors.

Submit(PDFServicesJob)

Creates the PDFServicesJob and returns the polling URL.

Declaration
public string Submit(PDFServicesJob pdfServicesJob)
Parameters
Type Name Description
PDFServicesJob pdfServicesJob

The PDFServicesJob to be submitted; cannot be null.

Returns
Type Description
System.String

Polling URL that can be used to get the status and result of the job.

Exceptions
Type Condition
ServiceApiException

Thrown if an error is encountered while submitting the job.

SDKException

Thrown for client-side or network errors.

ServiceUsageException

Thrown if service usage limits have been reached or credentials quota has been exhausted.

Submit(PDFServicesJob, IList<NotifierConfig>)

Creates the PDFServicesJob with the given NotifierConfig and returns the polling URL.

Declaration
public string Submit(PDFServicesJob pdfServicesJob, IList<NotifierConfig> notifierConfigList)
Parameters
Type Name Description
PDFServicesJob pdfServicesJob

The PDFServicesJob to be submitted; cannot be null.

System.Collections.Generic.IList<NotifierConfig> notifierConfigList

List of NotifierConfig to be used for notification; cannot be null.

Returns
Type Description
System.String

Polling URL that can be used to get the status and result of the job.

Exceptions
Type Condition
ServiceApiException

Thrown if an error is encountered while submitting the job.

SDKException

Thrown for client-side or network errors.

ServiceUsageException

Thrown if service usage limits have been reached or credentials quota has been exhausted.

Upload(Stream, String)

Uploads content from an input stream and returns an IAsset to be used in PDF Services SDK.

Method will not close the input stream, responsibility of closing the input stream lies with the client.

Declaration
public IAsset Upload(Stream inputStream, string mimeType)
Parameters
Type Name Description
System.IO.Stream inputStream

Input stream that is to be uploaded; cannot be null.

System.String mimeType

MIME type of the input stream; cannot be null or empty.

Returns
Type Description
IAsset

IAsset containing the uploaded content.

Exceptions
Type Condition
ServiceApiException

Thrown if an error is encountered while uploading the asset.

SDKException

Thrown for client-side or network errors.

ServiceUsageException

Thrown if service usage limits have been reached or credentials quota has been exhausted.

UploadAssets(List<StreamAsset>)

Uploads content from a list of StreamAsset and returns a list of IAsset to be used in PDF Services SDK.

Method will not close the input stream of the Stream Asset, responsibility of closing the input stream lies with the client.

Declaration
public List<IAsset> UploadAssets(List<StreamAsset> uploadAssetList)
Parameters
Type Name Description
System.Collections.Generic.List<StreamAsset> uploadAssetList

List of StreamAsset that is to be uploaded; cannot be null.

Returns
Type Description
System.Collections.Generic.List<IAsset>

List of IAsset containing the assets with uploaded content.

Exceptions
Type Condition
ServiceApiException

Thrown if an error is encountered while uploading the assets.

SDKException

Thrown for client-side or network errors.

ServiceUsageException

Thrown if service usage limits have been reached or credentials quota has been exhausted.

In This Article
  • Constructors
    • PDFServices(ICredentials)
    • PDFServices(ICredentials, ClientConfig)
  • Methods
    • DeleteAsset(IAsset)
    • GetContent(IAsset)
    • GetJobResult<T>(String, Type)
    • GetJobStatus(String)
    • RefreshDownloadURI(IAsset)
    • Submit(PDFServicesJob)
    • Submit(PDFServicesJob, IList<NotifierConfig>)
    • Upload(Stream, String)
    • UploadAssets(List<StreamAsset>)
Back to top Copyright © 2020 Adobe. All rights reserved.