Remove Watermarks

Introduction

This REST API allows removing watermarks from the document.

The operation performs a search for possible watermarks and then removes them.

The API supports a rich set of search criteria that allows finding images and texts that may be possible watermarks.

There are two popular scenarios to use the Remove operation:

  1. Remove particular watermarks found by search criteria. With this scenario Two operations are used: Search and Remove: 1*. You define the search criteria set; 1*. You first use **Search** operation with the designed criteria and get the response with search results; 1*. You can analyze the response and choose those watermarks that should be deleted; 1*. You then call **Remove** operation with the same set of search criteria; 1*. You also provide **RemoveIds **array with IDs of found watermarks; 1*. Then watermarks with passed IDs will be removed
  2. Remove all found watermarks. With this scenario: 1*. You define search criteria and pass them as parameters 1*. You don’t provide **RemoveIds **array 1*. Then all the found watermarks will be removed

The table below contains the full list of properties.

#Name#Description#Comment
FileInfo.FilePathThe path of the document, located in the storageRequired
FileInfo.StorageNameStorage nameCould be omitted for default storage
FileInfo.PasswordThe password to open fileShould be specified only for password-protected documents
OutputFolderThe folder for the resultant file"watermark/removed_watermark” is default
TextSearchCriteriaSearch criteria allowing filtering by watermark text
TextSearchCriteria.SearchTextThe exact string to search for
ImageSearchCriteriaSearch criteria for finding images
ImageSearchCriteria.ImageFileInfoImage to search for.
ImageFileInfo.FilePathThe path of the image, located in the storageRequired
ImageFileInfo.StorageNameStorage name
ImageFileInfo.PasswordThe password to open image
SizeSearchCriteriaSearch criteria allowing filtering by watermark size
SizeSearchCriteria.DimensionThe dimension of a watermark to search byPossible values: Height, Width
SizeSearchCriteria.MaximumDimension ending value
SizeSearchCriteria.MinimumDimension starting value
RotateAngleSearchCriteriaSearch criteria allowing filtering by watermark rotate angle
RotateAngleSearchCriteria.MaximumAngleEnding angle in degrees
RotateAngleSearchCriteria.MinimumAngleStarting angle in degrees
TextFormattingSearchCriteriaSearch criteria allowing filtering by text formatting
TextFormattingSearchCriteria.ForegroundColorRangeThe range of colors which are used to filter watermarks by text foreground color
TextFormattingSearchCriteria.BackgroundColorRangeThe range of colors which are used to filter watermarks by the text background color.
TextFormattingSearchCriteria.FontNameName of the font which is used in possible watermark text formatting.
TextFormattingSearchCriteria.MinFontSizeStarting value of the font size.
TextFormattingSearchCriteria.MaxFontSizeEnding value of the font size.
TextFormattingSearchCriteria.FontBoldIndicating whether the font used in watermark text formatting is bold.
TextFormattingSearchCriteria.FontUnderlineIndicating whether the font used in watermark text formatting is underline.
TextFormattingSearchCriteria.FontStrikeoutIndicating whether the font used in watermark text formatting is a strikeout.
TextFormattingSearchCriteria.FontItalicIndicating whether the font used in watermark text formatting is italic.
RemoveIdsCollection of possible watermarks IDs to remove.The array contains IDs returned by Search operation.

In case the array is not passed, all the found possible watermarks are removed.

ColorRange

#Name#Description#Comment
ColorThe exact color from which the range is created
IsEmptyIndicates whether only the empty color is in range
MaxBrightnessThe ending brightness value.
MaxHueThe ending hue value, in degrees.
MaxSaturationThe ending saturation value.
MinBrightnessThe starting brightness value.
MinHueThe starting hue value, in degrees.
MinSaturationThe starting saturation value.

Color

#Name#Description#Comment
AThe alpha component value of the color
RThe red component value of the color
GThe green component value of the color
BThe blue component value of the color
ARGBThe 32-bit ARGB value
NameA system-defined color name
IsEmptyIndicates whether Color is uninitialized

Resource URI

HTTP POST ~~/watermark/remove

Swagger UI lets you call this REST API directly from the browser.

cURL Example

Request


* First get JSON Web Token
* Please get your App Key and App SID from https://dashboard.groupdocs.cloud/#/apps. Kindly place App Key in "client_secret" and App SID in "client_id" argument.
curl -v "https://api.groupdocs.cloud/connect/token" \
-X POST \
-d "grant_type#client_credentials&client_id#xxxx&client_secret#xxxx" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
   
* cURL example to get document information
curl -v "https://api.groupdocs.cloud/v1.0/watermark/remove" \
-X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer <jwt token>"
-d "{
    "FileInfo": {
        "FilePath": "with_watermarks\\sample.pdf"
    },
    "OutputFolder": "removed_watermarks",
    "TextSearchCriteria": {
        "SearchText": "Watermark text"
    },
    "ImageSearchCriteria": {
        "ImageFileInfo": {
            "FilePath": "watermark_images\\sample_watermark.png",
            "StorageName": ""
        }
    }
}"

Response

{
    "downloadUrl": "https://api.groupdocs.cloud/v1.0/watermark/storage/file/removed_watermarks/sample_pdf/sample.pdf",
    "path": "removed_watermarks/sample_pdf/sample.pdf"
}

SDKs

Our API is completely independent of your operating system, database system or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone and time-consuming. Therefore, we have provided and support API SDKs in many development languages in order to make it easier to integrate with us. If you use SDK, it Removes the Watermark API calls and lets you use GroupDocs Cloud features in a native way for your preferred language.

SDK Examples

C#

Java