public function setImageFormat($imageformat,$pngScaleFactor = null){
        if($imageformat == self::$IMAGE_FORMAT_JPEG){
            $this->imageDeviceCommand = "jpeg";
            $this->imageExtention="jpg";
            $this->pngDownScaleFactor = isset($pngScaleFactor) ? "-dDownScaleFactor=".$pngScaleFactor : "";
        }else if($imageformat == self::$IMAGE_FORMAT_PNG){
            $this->imageDeviceCommand = "png16m";
            $this->imageExtention="png";
            $this->pngDownScaleFactor = "";
        }
        return $this;
    }