81
General / trim + bleed size
« Last post by Nick Riviera on April 29, 2021, 09:35:16 AM »Hi,
I have this script (from RTT) which adds in the file name the trim box size ex "test_210x297 mm.pdf"
In this script can be added also the bleed size? ex "test_210x297 mm + 10 mm bleed.pdf".
If there is no bleed in the document then "test_210x297 mm + 0 mm bleed.pdf"
Thanks a lot
I have this script (from RTT) which adds in the file name the trim box size ex "test_210x297 mm.pdf"
In this script can be added also the bleed size? ex "test_210x297 mm + 10 mm bleed.pdf".
If there is no bleed in the document then "test_210x297 mm + 0 mm bleed.pdf"
Thanks a lot
Code: [Select]
function TS() {
var Size = '';
var Page = BatchFile.Pages(0);
if (Page) {
var box = Page.TrimBox ? Page.TrimBox : Page.CropBox ? Page.CropBox : Page.MediaBox;
if (Page.Rotation == 90 || Page.Rotation == 270) {
Size = GetDist_mm(box.top, box.bottom).toFixed() + 'x' + GetDist_mm(box.left, box.right).toFixed() + ' mm';
} else {
Size = GetDist_mm(box.left, box.right).toFixed() + 'x' + GetDist_mm(box.top, box.bottom).toFixed() + ' mm';
}
}
BatchFile.close();
return Size;
}
function GetDist_mm(x1, x2) {
return Math.abs(x1 - x2) * 25.4 / 72
}