Crop and resize EPS
Native JavaScript API Solution to manage size of EPS images.
Need to perfectly fit EPS images into your layouts? Our powerful JavaScript API solution allows you to effortlessly crop and resize Encapsulated PostScript files directly within your applications. Gain total control over your vector graphics. Optimize visuals, create stunning compositions, and streamline your development process. Easy to integrate, incredibly effective.
Our technology intelligently processes only the image header and setup section of your EPS file, leaving the core content completely untouched. This ensures your file size remains exactly the same, resulting in a seamless and highly efficient resizing process.:
Determine the existing size of your image.
- Choose the units that best suit your needs: Points (1/72 of an inch), Inches, Millimeters, Centimeters, or Percents.
Aspose.Page provides you with the functionality to manage the borders of EPS files easily. With this API, you can scale or crop images using C#. To learn more about how to deal with EPS files , follow the documentation. To see the live version of the functionality, try EPS Crop and EPS Resize cross-platform apps.
To use the functionality, you first need to get the solution:
download its latest version directly from releases page , and follow instruction to install.
Steps to change the size of EPS image.
The example below shows the process of resizing .eps with the chosen units - points. The order is:
- Create file reader ‘const file_reader = new FileReader();’ and read file ‘file_reader.readAsArrayBuffer(e.target.files[0]);’.
- On load event handler call AsposeResizeEPS and pass the file content and its name, new size as width and height, and unit type to it.
- The result JSON contains the file name in fileNameResult.
- You can download a file by using the DownloadFile function: ‘DownloadFile(json.fileNameResult, ‘image/eps’);’.
Resize EPS
var fResizeEPS = function (e) {
const file_reader = new FileReader();
file_reader.onload = (event) => {
const json = AsposeResizeEPS(event.target.result, e.target.files[0].name, e.target.files[0].name + '_resize.eps', 200, 100, Module.Units.Points);
if (json.errorCode == 0) {
DownloadFile(json.fileNameResult, 'image/eps');
}
else
document.getElementById('output').textContent = json.errorText;
}
file_reader.readAsArrayBuffer(e.target.files[0]);
}
Steps to crop the EPS image.
The example below shows the process of cropping instead of resizing .eps. The order is:
- Create file reader ‘const file_reader = new FileReader();’ and read file ‘file_reader.readAsArrayBuffer(e.target.files[0]);’.
- On load event handler call AsposeCropEPS and pass the file content and its name, and left, top, right, bottom bounds of the new box to it.
- The result JSON contains the file name in fileNameResult.
- You can download a file by using the DownloadFile function: ‘DownloadFile(json.fileNameResult, ‘image/eps’);’.
Crop EPS
var fResizeEPS = function (e) {
const file_reader = new FileReader();
file_reader.onload = (event) => {
const json = AsposeCropEPS(event.target.result, e.target.files[0].name, e.target.files[0].name + '_crop.eps', 30, 5, 240, 36);
if (json.errorCode == 0) {
DownloadFile(json.fileNameResult, 'image/eps');
}
else
document.getElementById('output').textContent = json.errorText;
}
file_reader.readAsArrayBuffer(e.target.files[0]);
}
FAQ
1. Is it possible to crop EPS files?
EPS files are essentially PostScript files encapsulated within a bounding box, and they can be cropped by modifying the bounding box parameters to specify the desired region of the image. This process effectively trims away any unwanted areas of the EPS image.
2. How can I crop an Encapsulated PostScript file?
Aspose.Page lets you crop EPS files using the ExtractEpsSize() static Method to get the size of the actual file and crop it to a new size in points with the ResizeEps() static Method.
3. Are there any tools or software specifically designed for cropping EPS (Encapsulated PostScript) files?
Aspose.Page has EPS Crop cross-platform application that lets you crop files online in just a second.
EPS What is EPS File Format
EPS (EPSF) or Encapsulated PostScript File Format is the format that is actually a PS program that describes what would a single page look like. It is actually limited PS plus particular notes that help encapsulate PostScript graphics to another document. EPS perfectly supports vector graphics or combined vector-raster graphics. The peculiarity of the format is that as soon as it is imported into a document, it cannot be edited anymore. That is one of the reasons to convert this format to the one you are able to work with.