Search Watermarks

This REST API allows finding watermarks in the document.

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

The Search operation response contains not only watermark properties, but also IDs that can be used in Remove operation.

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/found_watermark” is default
SaveFoundImagesIndicates whether found images should be saved.
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 the 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.
ObjectsToSearchSearchable objects options.
ObjectsToSearch.WordProcessingObjectsThe word processing searchable objects.Possible values: All, Hyperlinks, Text, Shapes, None
ObjectsToSearch.SpreadsheetObjectsThe spreadsheet searchable objects.Possible values: All, AttachedImages, Hyperlinks, Cells, WorksheetBackgrounds, HeadersFooters, ChartsBackgrounds, Shapes, None
ObjectsToSearch.PresentationObjectsThe presentation searchable objects.Possible values: All, Hyperlinks, SlidesBackgrounds, ChartsBackgrounds, Shapes, None
ObjectsToSearch.DiagramObjectsThe diagram searchable objects.Possible values: All, Hyperlinks, HeadersFooters, Comments, Shapes, None
ObjectsToSearch.PdfObjectsThe pdf searchable objects.Possible values: All, AttachedImages, Hyperlinks, Text, Annotations, Artifacts, XObjects, None
ObjectsToSearch.EmailObjectsThe email searchable objects.Possible values: All, EmbeddedImages, AttachedImages, HtmlBody, PlainTextBody, Subject, None

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/search

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/search" \
-X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer <jwt token>"
-d "{
    "FileInfo": {
        "FilePath": "with_watermarks\\sample.pdf"
    },
    "OutputFolder": "found_image_watermarks",
    "SaveFoundImages": true,
    "TextSearchCriteria": {
        "SearchText": "Watermark text"
    },
    "ImageSearchCriteria": {
        "ImageFileInfo": {
            "FilePath": "watermark_images\\sample_watermark.png"
        }
    }
}"
{
    "watermarks": [
        {
            "id": 0,
            "text": "Watermark text",
            "imageUrl": null,
            "height": 20.0,
            "rotateAngle": 0.0,
            "unitOfMeasurement": "Point",
            "width": 135.57617187499997,
            "x": 229.8719140625,
            "y": 0.0,
            "possibleWatermarkType": "XObject"
        },
        {
            "id": 1,
            "text": null,
            "imageUrl": "https://localhost:5001/v1.0/watermark/storage/file/found_image_watermarks/sample_pdf/watermark_image_0",
            "height": 104.71043478260901,
            "rotateAngle": 0.0,
            "unitOfMeasurement": "Point",
            "width": 297.65999999999997,
            "x": 148.83,
            "y": 368.604782608696,
            "possibleWatermarkType": "XObject"
        },
        {
            "id": 2,
            "text": "Watermark text",
            "imageUrl": null,
            "height": 22.0,
            "rotateAngle": 0.0,
            "unitOfMeasurement": "Point",
            "width": 135.57617187499997,
            "x": 229.8719140625,
            "y": 0.0,
            "possibleWatermarkType": "Text"
        },
        {
            "id": 3,
            "text": "Watermark text",
            "imageUrl": null,
            "height": 20.0,
            "rotateAngle": 0.0,
            "unitOfMeasurement": "Point",
            "width": 135.57617187499997,
            "x": 229.8719140625,
            "y": 0.0,
            "possibleWatermarkType": "XObject"
        },
        {
            "id": 4,
            "text": null,
            "imageUrl": "https://localhost:5001/v1.0/watermark/storage/file/found_image_watermarks/sample_pdf/watermark_image_1",
            "height": 104.71043478260901,
            "rotateAngle": 0.0,
            "unitOfMeasurement": "Point",
            "width": 297.65999999999997,
            "x": 148.83,
            "y": 368.604782608696,
            "possibleWatermarkType": "XObject"
        },
        {
            "id": 5,
            "text": "Watermark text",
            "imageUrl": null,
            "height": 22.0,
            "rotateAngle": 0.0,
            "unitOfMeasurement": "Point",
            "width": 135.57617187499997,
            "x": 229.8719140625,
            "y": 0.0,
            "possibleWatermarkType": "Text"
        }
    ]
}

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 Searches the Watermark API calls and lets you use GroupDocs Cloud features in a native way for your preferred language.