2 Replies Latest reply on Oct 25, 2012 11:56 PM by MD_quake

    setPageBoxes + Trim and Bleed

    MD_quake

      Hello,

       

      I’m using Acrobat X prof and I’m trying to set page boxes (crop, trim and bleed) through javascript but the only box I’m able to set/change is the cropbox!

       

      This is the code I’m working with and what I run from within the javascript console:

       

      var rCrop = this.getPageBox("Crop",this.pageNum);

      rCrop[0] += 56.69290161; // Adjust Left Side

      rCrop[1] -= 56.69290161; // Adjust Top Side

      rCrop[2] -= 56.69290161; // Adjust Right Side

      rCrop[3] += 56.69290161; // Adjust Bottom Side

      this.setPageBoxes("Crop",this.pageNum,this.pageNum,rCrop);

       

      By changing “Crop” in the last row to “Trim” or “Bleed” and re-execute the code I thought I should be able to set those boxes as well?

      Eventually I’m going to set all these 3 boxes to different values but for now I’m just trying to set the bleed and trim!

       

      Any ideas of  what I’m doing wrong would be much appreciated.

       

      Regards

      MD

        • 1. Re: setPageBoxes + Trim and Bleed
          Test Screen Name Most Valuable Participant

          I don't know, but I wonder if you might be, in testing, accidentally setting illegal values.

           

          For instance, it is a rule that the bleed box must be no smaller than the trim box. No other box can be larger than the media box. There are other defined relationships.

          • 2. Re: setPageBoxes + Trim and Bleed
            MD_quake Level 1

            It seems that Acrobat doesn't "recognize" the page boxes immediately after they been set by the script.

            I used to check if they were set by going into the "Set Page Boxes" dialog but looking on the different boxes showed no changes!

            But if you do a preflight and check the Overview -> Page... Page information you will see that the different page boxes are in fact changed!

            So save your PDF and reopen it to be able to check the page boxes through the dialog!

             

            Hope this information might be of use for someone else.

             

            /MD