AsposeCropEPS

AsposeCropEPS function

Crops EPS file. It saves initial EPS file with updated existing %%BoundingBox or new one will be created.

function AsposeCropEPS(
    fileBlob,
    fileName, 
    fileNameResult, 
    left,
    top,
    right,
    bottom
)
ParameterTypeDescription
fileBlobBlob objectContent of source file.
fileNamestringSource file name.
fileNameResultstringResult file name.
leftfloatSpecifies left bound of crop box.
topfloatSpecifies top bound of crop box.
rightfloatSpecifies right bound of crop box.
bottomfloatSpecifies bottom bound of crop box.

Return Value

JSON object

FieldDescription
errorCodecode error (0 no error)
errorTexttext error ("" no error)
fileNameResultresult file name

Examples

const AsposePage = require('asposepagenodejs');

const eps_file = "./data/PAGENET-361-10.eps";

console.log("Aspose.Page for Node.js via C++ examples.");

AsposePage().then(AsposePageModule => {

    //CropEPS - working with EPS
    const json = AsposePageModule.AsposeCropEPS(eps_file, "croped.eps", 30, 5, 240, 36);
    console.log("CropEPS => %O",  json.errorCode == 0 ? JSON.parse(JSON.stringify(json).replace('"errorCode":0,"errorText":"",','')) : json.errorText);
},
    reason => {console.log(`The unknown error has occurred: ${reason}`);}
);

See Also