1 Reply Latest reply on Nov 1, 2012 5:13 AM by -hans-

    set JPG export size (width/height) in px

    martinpet

      Hi all,

       

      is there a way to define the dimensions of an jpg exported object, like width/height in px (e.g. when exporting a selected object)?

       

      I have severeal quadratic frames that i'm exporting via script, these frames are of diferent size on each page. Now i'd like to define the export dimensions to let's say 200 x 200px.

       

      Ist there a way to achieve that?

       

      Thanks and regards,

      Martin

        • 1. Re: set JPG export size (width/height) in px
          -hans- Level 4

          app.scriptPreferences.measurementUnit = MeasurementUnits.INCHES

          var currPageItem = app.selection[0];

          var currPageItemWidth = currPageItem.geometricBounds[3] - currPageItem.geometricBounds[1];

          app.jpegExportPreferences.exportResolution = (200 / currPageItemWidth);

          currPageItem.exportFile(ExportFormat.jpg, File('~/Desktop/test.jpg'), false);