Remove Watermarks

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;
    2. You first use Search operation with the designed criteria and get the response with search results;
    3. You can analyze the response and choose those watermarks that should be deleted;
    4. You then call Remove operation with the same set of search criteria;
    5. You also provide RemoveIds array with IDs of found watermarks;
    6. 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
    2. You don’t provide RemoveIds array
    3. Then all the found watermarks will be removed

The table below contains the full list of properties.

NameDescriptionComment
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

NameDescriptionComment
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

NameDescriptionComment
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

# First get JSON Web Token
# Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications.
# Kindly place Client Id in "client_id" and Client Secret in "client_secret" 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": ""
        }
    }
}"
{
    "downloadUrl": "https://api.groupdocs.cloud/v1.0/watermark/storage/file/removed_watermarks/sample_pdf/sample.pdf",
    "path": "removed_watermarks/sample_pdf/sample.pdf"
}

SDK examples

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.