Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

PageExporterUtility with JPEG resolution option

Return to Forums

  • Author
    Posts
    • #85722

      Hello,
      I wanted to expand the options of the script to be able to set the JPEG resolution.I managed to get the window and to choose the resolution, but the script always uses the last resolution which was used with the standard JPEG export option.
      I think i have add a line defining the resolution under Set JPEG options, but it didn’t worked.
      So if someone can give me hint, it would be great.

      /*
       * Get JPEG options
       */
      function getJPEGoptions(docName){
      	var temp = new Array();
      	var JPEGdlog = app.dialogs.add({name:"JPEG Options for \"" + docName + "\"", canCancel:true} );
      	with (JPEGdlog)
      		with (dialogColumns.add() ){
      			with (dialogRows.add() )
      				staticTexts.add({staticLabel:"Quality:"} );
      			JPEGquality = dropdowns.add({stringList:(new Array("Low","Medium","High","Maximum")) , minWidth:50, selectedIndex:peuINFO.defaultJPEGquality} );
      			with (dialogRows.add() )
      				staticTexts.add({staticLabel:"Encoding Type:"} );
      				JPEGrender = dropdowns.add({stringList:["Baseline","Progressive"] , minWidth:50, selectedIndex:peuINFO.defaultJPEGrender } );
      		with (dialogRows.add() )
      				staticTexts.add({staticLabel:"Resolution:"} );
      				JPEGresolution= dropdowns.add({stringList:["72","150","300","600"] , minWidth:50, selectedIndex:peuINFO.defaultJPEGresolution } );
              }
      	if(JPEGdlog.show() ){
      		peuINFO.defaultJPEGquality = JPEGquality.selectedIndex;
      		temp["qualityType"] = peuINFO.defaultJPEGquality;
      		peuINFO.defaultJPEGrender = JPEGrender.selectedIndex;
      		temp["renderType"] = peuINFO.defaultJPEGrender;
               peuINFO.defaultJPEGResolution = JPEGresolution.selectedIndex;
      		temp["ResolutionType"] = peuINFO.defaultJPEGresolution;	
          }
      	else{
      		JPEGdlog.destroy();
      		byeBye("JPEG exporting has been canceled by user.",peuINFO.sayCancel);
      	}
      	JPEGdlog.destroy();
      	return temp;
      }
      
      /*
       * Set JPEG options
       */
      function setJPEGoptions(theINFO){
      	with(app.jpegExportPreferences){
      		peuINFO.origSpread = exportingSpread; // Used to reset to original state when done
      		exportingSpread = currentINFO.doSpreadsON;
      		exportingSelection = false; // Export the entire page
      		if(peuINFO.csVersion > 3)
      			jpegExportRange = ExportRangeOrAllPages.exportRange;
      		switch (theINFO.qualityType){
      			case 0:
      				jpegQuality = JPEGOptionsQuality.low;
      				break;
      			case 1:
      				jpegQuality = JPEGOptionsQuality.medium;
      				break;
      			case 2:
      				jpegQuality = JPEGOptionsQuality.high;
      				break;
      			case 3:
      				jpegQuality = JPEGOptionsQuality.maximum;
      				break;
      		}
      		jpegRenderingStyle = (theINFO.renderType)? JPEGOptionsFormat.baselineEncoding : JPEGOptionsFormat.progressiveEncoding;
      	}
      }
      
Viewing 0 reply threads
  • You must be logged in to reply to this topic.
Forum Ads