Crop Image - Precise Editing API
PDF4me Crop Image is a powerful enterprise-grade solution that crops images with precise control through advanced API integration. This comprehensive image cropping service efficiently processes image files, providing both border-based and rectangle-based cropping options with pixel-perfect positioning, custom dimensions, and advanced image processing capabilities for enhanced image editing and optimization. The API processes image cropping by receiving source images through REST API calls, utilizing advanced cropping technology and intelligent positioning algorithms for accurate image manipulation and professional image processing. With comprehensive support for multiple cropping methods, precise coordinate control, custom dimensions, and professional image processing, this solution is ideal for image editing, content optimization, automated cropping, and enterprise image workflows that require reliable image cropping with guaranteed accuracy and consistent output quality. Crop Image documents easily with API for advanced image processing and editing.
Authenticating Your API Request
To access the PDF4me REST API, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user of the REST API.
Key Features
- Dual Cropping Methods: Support for both border-based and rectangle-based cropping approaches
- Pixel-Perfect Control: Precise coordinate positioning for accurate image cropping
- Custom Dimensions: Flexible width and height control for optimal image sizing
- Border Cropping: Remove unwanted borders with precise border value control
- Rectangle Cropping: Extract specific rectangular regions with exact positioning
- Professional Results: High-quality image cropping with accurate positioning and sizing
- Seamless API Integration: RESTful API designed for automated image processing workflows and enterprise system integration
REST API Endpoint
The PDF4me REST API uses standard HTTP methods to interact with resources. All image cropping operations are performed through a single endpoint:
- Method: POST
- Endpoint:
/api/v2/CropImage?schemaVal=Border
Supported Image Cropping Features
The API provides comprehensive support for various image cropping and editing capabilities:
Cropping Methods
- Border Cropping: Remove unwanted borders by specifying left, right, top, and bottom border values
- Rectangle Cropping: Extract specific rectangular regions using upper-left coordinates and dimensions
- Precise Control: Pixel-perfect positioning for accurate image manipulation
- Professional Results: High-quality cropping with accurate border removal and region extraction
- Advanced Processing: Support for complex image structures and cropping requirements
Positioning and Sizing
- Coordinate Control: Precise X and Y positioning for exact crop area placement
- Dimension Control: Custom width and height specification for optimal image sizing
- Border Management: Flexible border value control for content optimization
- Professional Layout: High-quality image cropping with accurate positioning
- Advanced Processing: Support for various image sizes and cropping scenarios
Image Processing
- Quality Preservation: Maintain image quality during cropping operations
- Format Support: Support for various image formats and file types
- Professional Enhancement: High-quality image processing with accurate cropping
- Flexible Options: Customizable processing parameters for specific requirements
REST API Parameters
Complete list of parameters for the Crop Image REST API. Parameters are organized by category for better understanding and implementation.
Important: Parameters marked with an asterisk (*) are required and must be provided for the API to function correctly.
Required Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| docName* | String | The source image filename with proper file extension for image cropping operations. This parameter identifies the input image for cropping processing, image editing, and optimization workflows. Required for image identification and processing pipeline management in image cropping operations. | output |
| docContent* | Base64 | The complete content of the source image encoded in Base64 format for image cropping processing. This parameter contains the entire image data required for cropping, editing, and optimization workflows. Essential for secure image handling and API-based image cropping operations. | JVBERi... |
| Crop Type* | String | Select the cropping method for image processing operations. Choose from Border for border-based cropping or Rectangle for coordinate-based rectangular cropping. This parameter determines the cropping strategy and ensures proper image manipulation for different editing requirements. | Border |
| Left Border* | Integer | Specify the left border value in pixels for border-based cropping operations. This parameter controls the amount of content to remove from the left edge of the image. Use integer values for precise border control and content optimization in image editing workflows. | 10 |
| Right Border* | Integer | Specify the right border value in pixels for border-based cropping operations. This parameter controls the amount of content to remove from the right edge of the image. Use integer values for precise border control and content optimization in image editing workflows. | 20 |
| Top Border* | Integer | Specify the top border value in pixels for border-based cropping operations. This parameter controls the amount of content to remove from the top edge of the image. Use integer values for precise border control and content optimization in image editing workflows. | 20 |
| Bottom Order* | Integer | Specify the bottom border value in pixels for border-based cropping operations. This parameter controls the amount of content to remove from the bottom edge of the image. Use integer values for precise border control and content optimization in image editing workflows. | 20 |
| Upper Left X* | Integer | Specify the X coordinate of the upper-left corner for rectangle-based cropping operations. This parameter defines the starting horizontal position for rectangular crop area selection. Use integer values for precise coordinate positioning and accurate image cropping. | 10 |
| Upper Left Y* | Integer | Specify the Y coordinate of the upper-left corner for rectangle-based cropping operations. This parameter defines the starting vertical position for rectangular crop area selection. Use integer values for precise coordinate positioning and accurate image cropping. | 10 |
| Width* | Integer | Specify the width of the crop area in pixels for rectangle-based cropping operations. This parameter controls the horizontal dimension of the rectangular crop region. Use integer values for precise dimension control and optimal image sizing. | 50 |
| Height* | Integer | Specify the height of the crop area in pixels for rectangle-based cropping operations. This parameter controls the vertical dimension of the rectangular crop region. Use integer values for precise dimension control and optimal image sizing. | 50 |
Output
The PDF4me Crop Image REST API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:
- JSON
- Table
- Schema
- Binary
JSON Response Format
The raw JSON response from the API:
{
"File Content": "Output file content from the PDF4me Connect"
}
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| File Content | Output file content from the PDF4me Connect |
Schema View
The data structure and types of the response:
1 item
File Content: Binary Output file content from the PDF4me Connect
Type Indicators:
Binary= Binary data
Binary Data View
The actual cropped image file data:
data
─────────────────────────────
File Content: Output file content from the PDF4me Connect
Binary Data Access:
- Image Content: Ready for download or further processing
- Cropped Image: Complete image with applied cropping
Request Example
Header
Content-Type: application/json
Authorization: YOUR_API_KEY
Note: Get your API key from the PDF4me Dashboard
Payload
{
"docContent": "Please put image base64 content",
"docName": "output",
"CropType": "Border",
"LeftBorder": 10,
"RightBorder": 20,
"TopBorder": 20,
"BottomBorder": 20,
"UpperLeftX": 10,
"UpperLeftY": 10,
"Width": 50,
"Height": 50
}
Code Samples
The PDF4me Crop Image REST API provides code samples in multiple programming languages. Choose the language that best fits your development environment:
- C#
- Java
- JavaScript
- Python
- Salesforce
- n8n
- Google Script
- AWS Lambda
Google Script Sample
Google Apps Script implementation for Google Workspace integration:
Image Cropping Features
Cropping Methods
- Border Cropping: Remove unwanted borders by specifying left, right, top, and bottom border values
- Rectangle Cropping: Extract specific rectangular regions using upper-left coordinates and dimensions
- Precise Control: Pixel-perfect positioning for accurate image manipulation
- Professional Results: High-quality cropping with accurate border removal and region extraction
- Advanced Processing: Support for complex image structures and cropping requirements
Positioning and Sizing
- Coordinate Control: Precise X and Y positioning for exact crop area placement
- Dimension Control: Custom width and height specification for optimal image sizing
- Border Management: Flexible border value control for content optimization
- Professional Layout: High-quality image cropping with accurate positioning
- Advanced Processing: Support for various image sizes and cropping scenarios
Image Processing
- Quality Preservation: Maintain image quality during cropping operations
- Format Support: Support for various image formats and file types
- Professional Enhancement: High-quality image processing with accurate cropping
- Flexible Options: Customizable processing parameters for specific requirements
Industry Use Cases & Applications
- Use Cases
Use Cases
- Image Editing: Crop images for content optimization and visual enhancement
- Content Management: Remove unwanted borders and optimize image content
- Social Media: Crop images for specific platform requirements and aspect ratios
- E-commerce: Optimize product images by cropping to focus on key features
- Web Design: Crop images for website layouts and responsive design
- Photography: Post-process images by cropping to improve composition
- Documentation: Crop screenshots and diagrams for technical documentation
- Business Process Automation: Automate image cropping workflows for enterprise operations