Class PDFElectronicSealJob
A job that allows clients to apply an electronic seal onto various PDF documents such as agreements, invoices, and more.
To know more about PDF Electronic Seal, please see the documentation.
Namespace: Adobe.PDFServicesSDK.pdfjobs.jobs
Assembly: Adobe.PDFServicesSDK.Doc.dll
Syntax
public class PDFElectronicSealJob : 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());
String sealFieldName = "Signature1";
FieldOptions fieldOptions = new FieldOptions.Builder(sealFieldName)
.SetFieldLocation(new FieldLocation(150, 250, 350, 200))
.SetPageNumber(1)
.Build();
CertificateCredentials certificateCredentials = CertificateCredentials.CSCCredentialBuilder()
.WithProviderName("<PROVIDER_NAME>")
.WithCredentialID("<CREDENTIAL_ID>")
.WithPin("<PIN>")
.WithCSCAuthContext(new CSCAuthContext("<ACCESS_TOKEN>"))
.Build();
PDFElectronicSealParams pdfElectronicSealParams =
PDFElectronicSealParams.PDFElectronicSealParamsBuilder(certificateCredentials, fieldOptions)
.Build();
PDFElectronicSealJob pdfElectronicSealJob = new PDFElectronicSealJob(asset, pdfElectronicSealParams);
String location = pdfServices.Submit(pdfElectronicSealJob);
PDFServicesResponse<PDFElectronicSealResult> pdfServicesResponse =
pdfServices.GetJobResult<PDFElectronicSealResult>(location, typeof(PDFElectronicSealResult));
IAsset resultAsset = pdfServicesResponse.Result.Asset;
StreamAsset streamAsset = pdfServices.GetContent(resultAsset);
Constructors
PDFElectronicSealJob(IAsset, PDFElectronicSealParams)
Constructs a new PDFElectronicSealJob
instance.
Declaration
public PDFElectronicSealJob(IAsset inputDocumentAsset, PDFElectronicSealParams pdfElectronicSealParams)
Parameters
Type | Name | Description |
---|---|---|
IAsset | inputDocumentAsset | The input IAsset for the job; can not be null. |
PDFElectronic |
pdfElectronicSealParams | The input PDFElectronic |
Methods
SetOutput(IAsset)
Sets the output asset for the job.
Declaration
public PDFElectronicSealJob SetOutput(IAsset asset)
Parameters
Returns
Type | Description |
---|---|
PDFElectronic |
|
Remarks
External assets can be set as output only when input is external asset as well
SetSealImageAsset(IAsset)
Sets the seal image asset for the job.
Declaration
public PDFElectronicSealJob SetSealImageAsset(IAsset sealImageAsset)
Parameters
Type | Name | Description |
---|---|---|
IAsset | sealImageAsset | IAsset object representing the seal image; can not be null. |
Returns
Type | Description |
---|---|
PDFElectronic |
|