> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/uwp/digital-signature/sign-pdf.md).

# Sign a PDF document in UWP

Learn how to digitally sign PDF files using the Apryse SDK. Ensure document authenticity with approval signatures and certificates. Get started now! The Apryse uwp SDK streamlines secure document proc

To sign an existing approval signature field in a PDF Document:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
PDFDoc document = new PDFDoc(inputDocumentPath);

// Retrieve the unsigned approval signature field.
Field foundApprovalField = document.GetField(inputApprovalFieldName);
DigitalSignatureField foundApprovalSignatureDigitalSignatureField = new DigitalSignatureField(foundApprovalField);

// (OPTIONAL) Add more information to the signature dictionary.
foundApprovalSignatureDigitalSignatureField.SetLocation("Vancouver, BC");
foundApprovalSignatureDigitalSignatureField.SetReason("Document approval.");
foundApprovalSignatureDigitalSignatureField.SetContactInfo("www.apryse.com");

// (OPTIONAL) Add an appearance to the signature field.
Image image = Image.Create(document.GetSDFDoc(), inputAppearanceImagePath);
SignatureWidget foundApprovalSignatureWidget = new SignatureWidget(foundApprovalField.GetSDFObj());
foundApprovalSignatureWidget.CreateSignatureAppearance(image);

// Prepare the signature and signature handler for signing.
foundApprovalSignatureDigitalSignatureField.SignOnNextSave(inputPrivateKeyFilePath, inputKeyFilePassword);

// The actual approval signing will be done during the following incremental save operation.
await document.SaveAsync(inputOutPath, SDFDocSaveOptions.e_incremental);
```

{% endcode %}
{% endtab %}
{% endtabs %}

[Digitally sign PDF files](/uwp/get-started/samples.md#digitalsignatures) Full code sample which demonstrates using the digital signature API to digitally sign and/or certify PDF documents.

## About Adding An Approval Signature to a PDF Document

The Apryse SDK enables approval signatures in PDF documents using a Digital Certificate, in accordance with the latest PDF specification. By leveraging [public key infrastructure (PKI)](https://en.wikipedia.org/wiki/Public_key_infrastructure) technology, with a certificate issued by a trusted [certificate authority (CA)](https://en.wikipedia.org/wiki/Certificate_authority), a signer can use a certificate-based digital ID to guarantee the authenticity of a signature. Placement of a digital signature using a certificate can also guarantee that a document was not modified since the signature was placed, ensuring the authenticity of the document.

![](https://3246663708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Frgmys2szYV2Z567Zu3vi%2Fuploads%2Fgit-blob-51c4b698c1ec2efcc0d46686d1342347626f1a9d%2F8130e2be0155c3a56bbf8548f836090a8beb0ac2-299x658.png?alt=media)

Image taken from Apryse WebViewer

Above is an example of a document containing a certified signature, guaranteed by a certificate generated by Apryse.com.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/uwp/digital-signature/sign-pdf.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
