Barryvdh\Snappy\PdfWrapper::output PHP Method

output() public method

Output the PDF as a string.
public output ( ) : string
return string The rendered PDF as string
    public function output()
    {
        if ($this->html) {
            return $this->snappy->getOutputFromHtml($this->html, $this->options);
        }
        if ($this->file) {
            return $this->snappy->getOutput($this->file, $this->options);
        }
        throw new \InvalidArgumentException('PDF Generator requires a html or file in order to produce output.');
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Output the PDF as a string.
  *
  * @return string The rendered PDF as string
  * @throws \InvalidArgumentException
  * @static 
  */
 public static function output()
 {
     return \Barryvdh\Snappy\PdfWrapper::output();
 }