Skip to main content
tpk1982
Legend
January 27, 2017
Answered

Crop slug areas in Pdf

  • January 27, 2017
  • 1 reply
  • 1059 views

Hi All,

I need slug information only for cover page (page 1). Rest of pages need not the slug portions. So am trying to crop the pages to remove slug areas except cover page using crop tool (with trim size).

Is it possible with scripting? I am novice in Acrobat scripting, i tried using with this forum previous thread.

var arrMedia = this.getPageBox({cBox:"Trim", nPage:1});

arrMedia[0] = 0;

arrMedia[1] = 0;

arrMedia[2] = 0;

arrMedia[3] -= 60;

this.setPageBoxes({cBox:"Trim", nStart:1, nEnd:this.numPages-1, rBox:arrMedia});

Thanks,

K

This topic has been closed for replies.
Correct answer Karl Heinz Kremer

Chances are that you want to set the crop box. Do you have a trim box in this document? If not, then also use the crop box in your first line. Also, you don't want to set three of the array members to 0. Please review the API documentation to find out what these values actually mean.

If your slug-line is at the top, you can use this:

var arrMedia = this.getPageBox({cBox:"Crop", nPage:1});

console.println(arrMedia.toSource());

arrMedia[1] -= 60;

this.setPageBoxes({cBox:"Crop", nStart:1, nEnd:this.numPages-1, rBox:arrMedia});

If the slug-line is at the bottom, change the one assignment to this:

arrMedia[3] += 60;

1 reply

Karl Heinz  Kremer
Community Expert
Karl Heinz KremerCommunity ExpertCorrect answer
Community Expert
January 27, 2017

Chances are that you want to set the crop box. Do you have a trim box in this document? If not, then also use the crop box in your first line. Also, you don't want to set three of the array members to 0. Please review the API documentation to find out what these values actually mean.

If your slug-line is at the top, you can use this:

var arrMedia = this.getPageBox({cBox:"Crop", nPage:1});

console.println(arrMedia.toSource());

arrMedia[1] -= 60;

this.setPageBoxes({cBox:"Crop", nStart:1, nEnd:this.numPages-1, rBox:arrMedia});

If the slug-line is at the bottom, change the one assignment to this:

arrMedia[3] += 60;

tpk1982
tpk1982Author
Legend
January 27, 2017

Thanks Karl.

Just want to make sure which measurement it will take by default in script? I have slug in bottom. If i use

arrMedia[3] += 60;

mean the 60 is mm or inches or points?

Also += means it will crop the slug, isnt it? -= means?

Regards,

K

try67
Community Expert
Community Expert
January 27, 2017

The unit is always PostScript Points.

"+=" means you're adding the value on the right to the existing value, "-=" means you're subtracting from it.