Set the output format.

@param string $outputFormat

@return $this

@throws \Spatie\PdfToImage\Exceptions\InvalidFormat
19708
public function setOutputFormat($outputFormat)
    {
        if (! $this->isValidOutputFormat($outputFormat)) {
            throw new InvalidFormat("Format {$outputFormat} is not supported");
        }

        $this->outputFormat = $outputFormat;

        return $this;
    }
595646
public function setOutputFormat($format = null, $quality = null, $filters = null) {

		if ($format) {
			$format = strtolower($format);

			if (in_array($format, static::$_allowed_formates)) {
				$this->_output_format = $format;

				# fix file extension if this method was called after calling setSaveOptions Method
				if ($this->_save_path) {
					$this->_save_name = preg_replace(
						'/(?<=\.)(?:png|jpeg|jpg|gif)$/i',
						$this->_output_format,
						$this->_save_name
					);

					$this->_save_path = $this->_save_dir . DIRECTORY_SEPARATOR . $this->_save_name;
				}
			}
		}

		// Quality
		$this->_output_options = [];
		if (is_numeric($quality)) {
			// if($format == 'jpg' || $format == 'jpeg')
			// {
			// 	if($quality < 0 || $quality > 100)
			// 		throw new ImageException(__METHOD__ . ' ' . $format . ' quality must be between 0-100');
			// }
			// else if($format == 'png')
			// {
			// 	if($quality < 0 || $quality > 9)
			// 		throw new ImageException(__METHOD__ . ' ' . $format . ' quality must be between 0-9');
			// }

			if ($this->_output_format == 'jpg' || $this->_output_format == 'jpeg') {
				$quality = round($quality * 100 / 100);
			} else if ($this->_output_format == 'png') {
				$quality = round($quality * 9 / 100);
			}

			$this->_output_options[] = $quality;
		}

		// Filters
		if ($filters !== null) {
			// Filters must come after quality
			if (empty($this->_output_options)) {
				$this->_output_options[] = null;
			}

			$this->_output_options[] = $filters;
		}

		return $this;
	}
505609
public function setFormats($formats)
    {
        if (is_array($formats)) {
            $formats = json_encode($formats);
        }

        $this->formats = $formats;

        return $this;
    }
843071
public function write($text, $formatOptions = array(), $pipe = TextWriter::STDOUT)
    {
        $this->console->write($this->format($text, $formatOptions), $pipe);
        return $this;
    }
1158991
public function setFormat($format)
    {
        if (JFactory::getApplication()->getCfg('sef_suffix') && $format === 'feed') {
            $format = 'rss';
        }

        return parent::setFormat($format);
    }
1327494
protected function setupFormatters(OutputFormatterInterface $formatter)
    {
        $formatter->setStyle(
            'file',
            new OutputFormatterStyle('white', 'default', ['bold'])
        );
        $formatter->setStyle(
            'source',
            new OutputFormatterStyle('blue', 'default', [])
        );
        $formatter->setStyle(
            'success',
            new OutputFormatterStyle('white', 'green', [])
        );
    }
93774
public function setFormat($format)
    {
        if (!in_array($format, self::$supportedFormats)) {
            throw new BuildException(
                sprintf(
                    'Invalid output format "%s", allowed are: %s',
                    $format,
                    implode(', ', self::$supportedFormats)
                )
            );
        }
        $this->format = $format;
    }
1095463
public function setFormat($format = false)
    {
        if(!$format)
        {
            $format = \Ginger\System\Parameters::$format;
        }
        $this->format   = $format;

        if(!isset($this->allowedFormats[$this->format]))
        {
            $this->format = $this->defaultFormat;
        }
    }
523340
public static function setOutputFormat($format)
    {
        $self = Debugger::getInstance();

        if (!isset($self->_templates[$format])) {
            throw new InvalidArgumentException('Invalid Debugger output format.');
        }
        $self->_outputFormat = $format;
    }
27714
public function setFormatter(\Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter)
    {
        $this->decoratedOutput->setFormatter($formatter);
    }
1039725
private function configureFormatter(OutputFormatter $formatter)
    {
        $style = new OutputFormatterStyle('yellow', null, ['bold']);
        $formatter->setStyle('pathbold', $style);

        $style = new OutputFormatterStyle('green');
        $formatter->setStyle('localname', $style);

        $style = new OutputFormatterStyle(null, null, ['bold']);
        $formatter->setStyle('node', $style);

        $style = new OutputFormatterStyle('blue', null, ['bold']);
        $formatter->setStyle('templatenode', $style);

        $style = new OutputFormatterStyle('blue', null, []);
        $formatter->setStyle('templateproperty', $style);

        $style = new OutputFormatterStyle(null, null, []);
        $formatter->setStyle('property', $style);

        $style = new OutputFormatterStyle('magenta', null, ['bold']);
        $formatter->setStyle('node-type', $style);

        $style = new OutputFormatterStyle('magenta', null, []);
        $formatter->setStyle('property-type', $style);

        $style = new OutputFormatterStyle(null, null, []);
        $formatter->setStyle('property-value', $style);

        $style = new OutputFormatterStyle(null, 'red', []);
        $formatter->setStyle('exception', $style);
    }
317523
public function format(string $format)
    {
        if (! $this->validateManipulation($format, 'format')) {
            throw InvalidManipulation::invalidParameter(
                'format',
                $format,
                $this->getValidManipulationOptions('format')
            );
        }

        return $this->addManipulation('format', $format);
    }
1028803
public function setFormat($format)
    {
        if (!in_array($format, self::$formats)) {
            throw new ImageException('Invalid image format provided. Supported formats are [jpg, jpeg, png, gif].');
        }

        $this->format = $format;
    }
13221
public function setFormat($value = null)
    {
        if ($value != null) {
            $this->_params['format'] = $value;
        } else {
            unset($this->_params['format']);
        }
        return $this;
    }
629389
public function setDisplayFormat($displayFormat)
    {
        if (!in_array($displayFormat, static::FORMATS)) {
            throw new \InvalidArgumentException("bad format '{$displayFormat}'");
        }
        $this->displayFormat = $displayFormat;

        return $this;
    }
121651
public function defaultFormat($format)
    {
        $this->default = $format;

        if (isset($this->formats[$format])) {
            $item = $this->formats[$format];
            $this->formats = [$format => $item] + $this->formats;
        }

        return $this;
    }
699973
public function setOutputFileName(string $outputFileName): self
    {
        assert(empty($outputFileName) === false);

        $this->outputFileName = $outputFileName;

        $this->reset();

        return $this;
    }