PDFPropertiesOperation

PDFPropertiesOperation

An Operation that is used to fetch properties from an input PDF file. The properties are returned in a JSON file.

Sample Usage:

const credentials =  PDFServicesSdk.Credentials.servicePrincipalCredentialsBuilder()
         .withClientId("PDF_SERVICES_CLIENT_ID")
         .withClientSecret("PDF_SERVICES_CLIENT_SECRET")
         .build(),
      clientContext = PDFServicesSdk.ExecutionContext.create(credentials),
      PDFProperties = PDFServicesSdk.PDFProperties,
      pdfPropertiesOperation = PDFProperties.Operation.createNew(),
      input = PDFServicesSdk.FileRef.createFromLocalFile('PDFPropertiesOperationInput.pdf',PDFProperties.SupportedSourceFormat.pdf);

pdfPropertiesOperation.setInput(input);

pdfPropertiesOperation.execute(clientContext)
	.then(result => console.log(result))
	.catch(err => console.log(err));

Members

(static, constant) SupportedSourceFormat

Description:
Properties:
Name Type Description
pdf string

Represents "application/pdf" media type

Supported source file formats for PDFPropertiesOperation.

Methods

(static) createNew() → {PDFPropertiesOperation}

Description:
Returns:

A new PDFPropertiesOperation instance.

Type
PDFPropertiesOperation

setInput(sourceFileRefnon-null)

Description:
  • Sets an input file.

Parameters:
Name Type Description
sourceFileRef FileRef

An input file.

setOptions(optionsopt)

Description:
  • Sets the options for this operation. See PDFPropertiesOptions for how to specify options for PDF Properties.

Parameters:
Name Type Attributes Description
options PDFPropertiesOptions <optional>

Options specifying the parameters for this operation; use null for default values.

execute(contextnon-null) → {Promise.<Object>}

Description:
  • Executes this operation using the supplied context and returns a Promise which resolves to the operation result.

Parameters:
Name Type Description
context ExecutionContext

The context in which the operation will be executed.

Throws:
  • if an API call results in an error response.

    Type
    ServiceApiError
  • if service usage limits have been reached or credentials quota has been exhausted.

    Type
    ServiceUsageError
Returns:

A promise which resolves to the operation result.

Type
Promise.<Object>