Working with Stamp Signature

Introduction

GroupDocs.Signature Cloud REST API supports to put Stamp Signature on supported file format. It provides methods to create Stamp Signature in Document Pages with different options to add image as stamp, location, alignment, font, margins and appearances by using Signature Options Object data in request body.

Add Stamp Signature to Document

You can create Stamp Signature on Document provided by fileName and document folder (if required) using following API. It expects Signature Options Object data in request body.

It returns an object which contains document name, folder location and command status.

Resource

The following GroupDocs.Signature Cloud REST API resource has been used in the example to add Stamp signature to a document.

cURL Example

Requestcurl –request POST
–url http:~/~/api.groupdocs.cloud/v1/signature/01_pages.png/stamp?folder#storage
–header ‘authorization: [Access Token]’
–header ‘content-type: application/json’
–data ‘{ “outerLines”: [ { “height”: 20, “backgroundColor”: { “Web”: “BlueViolet” }, “text”: " * John Smith * “, “font”: { “fontFamily”: “Arial”, “fontSize”: 12.0, “bold”: true, “italic”: true, “underline”: false }, “textColor”: { “Web”: “DarkOrange” }, “textBottomIntent”: 5, “textRepeatType”: “FullTextRepeat”, “outerBorder”: { “style”: “Default”, “transparency”: 0.7, “weight”: 2.0, “color”: { “Web”: “DarkOrange” } }, “innerBorder”: { “style”: “Default”, “transparency”: 0.5, “weight”: 2.0, “color”: { “Web”: “DarkOrange” } }, “visible”: true } ], “innerLines”: [ { “height”: 30, “backgroundColor”: { “Web”: “Transparent”, “Alpha”: 0 }, “text”: “John Smith”, “font”: { “fontFamily”: “Times New Roman”, “fontSize”: 20.0, “bold”: true, “italic”: true, “underline”: false }, “textColor”: { “Web”: “Gold” }, “textBottomIntent”: 3, “textRepeatType”: “None”, “visible”: true } ], “backgroundColor”: { “Web”: “CornflowerBlue” }, “backgroundColorCropType”: “OuterArea”, “backgroundImageCropType”: “MiddleArea”, “left”: 2, “top”: 2, “width”: 200, “height”: 150, “locationMeasureType”: “Pixels”, “sizeMeasureType”: “Pixels”, “rotationAngle”: 0, “horizontalAlignment”: “Left”, “verticalAlignment”: “Top”, “margin”: { “all”: 10, “left”: 10, “top”: 10, “right”: 10, “bottom”: 10 }, “marginMeasureType”: “Pixels”, “opacity”: 1.0, “signAllPages”: false, “documentPageNumber”: 1, “pagesSetup”: { “firstPage”: true, “lastPage”: false, “oddPages”: false, “evenPages”: false, “pageNumbers”: [ 1 ] }, “OptionsType”: “ImagesSignStampOptionsData” }’

Response

{
  "fileName": "01_pages.png",
  "folder": "Output",
  "code": 200,
  "status": "OK"
}

SDKs

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.

Add Stamp Signature to Document

Add Stamp Signature to Document at Provided URL

You can create Stamp Signature for document at provided URL with signature-options-objects. It retrieves file from specified URL and tries to detect file type when fileName parameter is not specified. It saves retrieved file in storage, by using fileName and folder parameters to specify desired file name and folder to save file. When file with specified name already exists in storage new unique file name will be used for file. It expects Signature Options Object data in request body and returns object which contains document name and folder location.

Resource

The following GroupDocs.Signature Cloud REST API resource has been used in the example to add Stamp signature to a document at provided URL.

cURL Example

curl --request POST \
--url http://api.groupdocs.cloud/v1/signature/stamp?url#https%3A%2F%2Fwww.dropbox.com%2Fs%2F3hbc18wympow0j1%2Ftest.png%3Fdl%3D1 \
--header 'authorization: [Access Token]' \
--header 'content-type: application/json' \
--data '{ "outerLines": [ { "height": 20, "backgroundColor": { "Web": "BlueViolet" }, "text": " * John Smith * ", "font": { "fontFamily": "Arial", "fontSize": 12.0, "bold": true, "italic": true, "underline": false }, "textColor": { "Web": "DarkOrange" }, "textBottomIntent": 5, "textRepeatType": "FullTextRepeat", "outerBorder": { "style": "Default", "transparency": 0.7, "weight": 2.0, "color": { "Web": "DarkOrange" } }, "innerBorder": { "style": "Default", "transparency": 0.5, "weight": 2.0, "color": { "Web": "DarkOrange" } }, "visible": true } ], "innerLines": [ { "height": 30, "backgroundColor": { "Web": "Transparent", "Alpha": 0 }, "text": "John Smith", "font": { "fontFamily": "Times New Roman", "fontSize": 20.0, "bold": true, "italic": true, "underline": false }, "textColor": { "Web": "Gold" }, "textBottomIntent": 3, "textRepeatType": "None", "visible": true } ], "backgroundColor": { "Web": "CornflowerBlue" }, "backgroundColorCropType": "OuterArea", "backgroundImageCropType": "MiddleArea", "left": 2, "top": 2, "width": 200, "height": 150, "locationMeasureType": "Pixels", "sizeMeasureType": "Pixels", "rotationAngle": 0, "horizontalAlignment": "Left", "verticalAlignment": "Top", "margin": { "all": 10, "left": 10, "top": 10, "right": 10, "bottom": 10 }, "marginMeasureType": "Pixels", "opacity": 1.0, "signAllPages": false, "documentPageNumber": 1, "pagesSetup": { "firstPage": true, "lastPage": false, "oddPages": false, "evenPages": false, "pageNumbers": [ 1 ] }, "OptionsType": "ImagesSignStampOptionsData" }'
{
  "fileName": "01_pages.png",
  "folder": "Output",
  "Code": 200,
  "Status" : "OK"
}

SDKs

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.

Add Stamp Signature to Document at specified URL

Setup Background Brush for Stamp Signatures

You can creates Text Signature for document with signature-options-objects. Signature Stamp Options and all inherited classes have been updated in (Release 18.7) with newly added property** BackgroundBrush** which support following brush types:

Linear Gradient Brush \

Brush Style option


"backgroundBrush": {"startColor": {"web": "CornflowerBlue"}, "endColor": {"web": "DarkBlue"}, "angle": 0.0, "brushType": "LinearGradientBrush"}

Radial Gradient Brush \

Brush Style option


"backgroundBrush": { "innerColor": {"web": "CornflowerBlue"}, "outerColor": {"web": "DarkBlue"}, "brushType": "RadialGradientBrush"}

Solid Brush \

Brush Style option


"backgroundBrush": {"color": {"web": "DarkBlue"}, "brushType": "SolidBrush"}

Texture Brush \

Brush Style option


"backgroundBrush": {"imageGuid": "images\signature_01.jpg", "brushType": "TextureBrush"}

Resource

The following GroupDocs.Signature Cloud REST API resource has been used in the example to add Text signature to a document.

cURL Example

curl --request POST \
--url http://api.groupdocs.cloud/v1/signature/01_pages.pptx/stamp?folder#storage \
--header 'authorization: [Access Token]' \
--header 'content-type: application/json' \
--data '{ "outerLines": [ { "height": 20, "backgroundColor": { "Web": "BlueViolet" }, "text": " * John Smith * ", "font": { "fontFamily": "Arial", "fontSize": 12.0, "bold": true, "italic": true, "underline": false }, "textColor": { "Web": "DarkOrange" }, "textBottomIntent": 5, "textRepeatType": "FullTextRepeat", "outerBorder": { "style": "Default", "transparency": 0.7, "weight": 2.0, "color": {  "Web": "DarkOrange" } }, "innerBorder": { "style": "Default", "transparency": 0.5, "weight": 2.0, "color": {  "Web": "DarkOrange" } }, "visible": true } ], "innerLines": [ { "height": 30, "backgroundColor": { "Web": "Transparent", "Alpha": 0 }, "text": "John Smith", "font": { "fontFamily": "Times New Roman", "fontSize": 20.0, "bold": true, "italic": true, "underline": false }, "textColor": { "Web": "Gold" }, "textBottomIntent": 3, "textRepeatType": "None", "visible": true } ], "backgroundColor": { "Web": "CornflowerBlue" }, "backgroundBrush": { "startColor": { "web": "LightBlue" }, "endColor": { "web": "DarkBlue" }, "angle": 45.0, "brushType": "LinearGradientBrush" }, "backgroundColorCropType": "OuterArea", "backgroundImageCropType": "MiddleArea", "left": 2, "top": 2, "width": 200, "height": 150, "locationMeasureType": "Pixels", "sizeMeasureType": "Pixels", "rotationAngle": 0, "horizontalAlignment": "Left", "verticalAlignment": "Top", "margin": { "all": 10, "left": 10, "top": 10, "right": 10, "bottom": 10 }, "marginMeasureType": "Pixels", "opacity": 1.0, "signAllPages": false, "documentPageNumber": 1, "pagesSetup": { "firstPage": true, "lastPage": false, "oddPages": false, "evenPages": false, "pageNumbers": [ 1 ] }, "OptionsType": "SlidesSignStampOptionsData" }'
{
  "fileName": "01_pages.pptx",
  "folder": "Output",
  "Code": 200,
  "Status" : "OK"
}

SDKs

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.

Setup Background Brush for Stamp Signatures