Link Search Menu Expand Document

How to crops empty space around images

The https://api.pdf.co/v1/pdf/edit/replace-text-with-image endpoint supports croppring empty spaces around images. To do this, please add the following parameter to request payload:

"profiles": "{ 'AutoCropImages': true }",

Here’s a sample request:

POST [https://api.pdf.co/v1/pdf/edit/replace-text-with-image](https://api.pdf.co/v1/pdf/edit/replace-text-with-image)

{
   "url": "https://file_url",
    "searchString": "{XM:employee_signature}",
    "replaceImage": "https://image_url",
    "profiles": "{ 'AutoCropImages': true }"
}