6 Replies Latest reply on Apr 15, 2015 7:09 AM by davido64523259

    Acrobat script select paper size depends on pdf size

    davido64523259

      Hi,

       

      I want to write a script if the overall image is less than 8"*10.5" then it would choose to print to 8.5"*11" paper but if it is a larger image it would set to print 11" * 17" paper.

      Following is my attempt so far.

       

      var aRect = this.getPageBox("Art",this.pageNum);
      var width = aRect[2] - aRect[0];
      var height = aRect[1] - aRect[3];
      
      var pp = this.getPrintParams();
      fv = pp.constants.flagValues;
      //pdf less than 8" * 10.5"
      if (width > 576 || width > 756) {
          pp.flags = fv.setPageSizes;
          this.print(pp);
      }
      

       

      i think i would need to pass some parameter to setPageSizes function but not sure how to do that.

      thank you for your time