Sign PDF with Stamp using REST API in Node.js

The stamp signature allows electronically signing PDF documents the same way that we use a rubber signature stamp on a paper document. We can sign PDF documents with a customized stamp signature programmatically on the cloud. In this article, we will learn how to sign PDF documents with stamp signatures using a REST API in Node.js.

The following topics shall be covered in this article:

PDF Signature REST API and Node.js SDK

For signing PDF documents, we will be using the Node.js SDK of GroupDocs.Signature Cloud API. It enables us to create, verify and search various types of signatures such as image, ‎barcode, QR-Code, text-based, digital, and stamp signatures. Please install it using the following command in the console:

npm install groupdocs-signature-cloud

Please get your Client ID and Secret from the dashboard before following the mentioned steps. Once you have your ID and secret, add in the code as shown below:

Sign PDF Documents using a REST API in Node.js

We can sign PDF documents on the cloud by following the simple steps given below:

Upload the Document

Firstly, we will upload the PDF document to the cloud using the code example given below:

As a result, the uploaded PDF file will be available in the files section of the dashboard on the cloud.

Sign PDF Documents with Stamp Signatures using Node.js

We can sign PDF files with stamp signatures programmatically by following the steps given below:

  • Create an instance of the SignApi.
  • Provide the uploaded PDF file path.
  • Initialize the SignDigitalOptions object and set various properties.
  • Define stamp text using StampLine objects.
  • Assign input file, SignDigitalOptions and SaveOptions to the SignSettings object.
  • Finally, sign the PDF using the SignApi.createSignatures() method.

The following code example shows how to sign a PDF document with stamp signatures using a REST API in Node.js.

Sign PDF Documents with Stamp Signatures using Node.js.

Sign PDF Documents with Stamp Signatures using Node.js.

Download the Signed File

The above code sample will save the signed PDF file on the cloud. It can be downloaded using the following code sample:

Try Online

Please try the following free online documents signature tool, which is developed using the above API. https://products.groupdocs.app/signature/

Conclusion

In this article, we have learned:

  • how to sign PDF documents with stamp signatures;
  • upload PDF file to the cloud;
  • how to download signed PDF file from the cloud.

Besides, you can learn more about GroupDocs.Signature Cloud API using the documentation. We also provide an API Reference section that lets you visualize and interact with our APIs directly through the browser. In case of any ambiguity, please feel free to contact us on the forum.

See Also