Get the raw content stream.

@return string
@throws PdfReaderException
@throws PdfTypeException
@throws FilterException
@throws PdfParserException
196564
public function getContentStream()
    {
        $dict = $this->getPageDictionary();
        $contents = PdfType::resolve(PdfDictionary::get($dict, 'Contents'), $this->parser);
        if ($contents instanceof PdfNull) {
            return '';
        }

        if ($contents instanceof PdfArray) {
            $result = [];
            foreach ($contents->value as $content) {
                $content = PdfType::resolve($content, $this->parser);
                if (!($content instanceof PdfStream)) {
                    continue;
                }
                $result[] = $content->getUnfilteredStream();
            }

            return \implode("\n", $result);
        }

        if ($contents instanceof PdfStream) {
            return $contents->getUnfilteredStream();
        }

        throw new PdfReaderException(
            'Array or stream expected.',
            PdfReaderException::UNEXPECTED_DATA_TYPE
        );
    }
525607
public function getBufferedContents(): string {
	    if ($this->jhtmlJsonPayload === null) {
	        return $this->htmlView->getBufferedContents();
	    }
	    
	    return $this->jhtmlJsonPayload->getBufferedContents();
	}
1297672
public function getBody()
    {
        $streamResource = fopen('php://memory', 'r+');
        if (is_resource($this->content)) {
            stream_copy_to_stream($this->content, $streamResource);
        } else {
            fwrite($streamResource, $this->content);
        }
        rewind($streamResource);

        return new ContentStream($streamResource);
    }
887126
public function getHeader()
    {
        if ($this->hasHeader) {
            return $this->header;
        }

        $this->updateConversion();

        if (!$this->getFilePath()) {
            return $this->header;
        }

        $detectorException = null;

        try {
            $header = $this->detector->header(
                $this->firstLines(),
                $this->getSeparator(),
                $this->getDelimiter()
            );
        } catch (DetectionFailedException $detectorException) {
            $header = [];
        }

        $this->headerWasDetected = $header && !$this->isNumericHeader($header);


        if ($this->headerWasDetected) {
            $this->setHeader($header);
            return $this->header;
        }

        // If the header could not be detected, check for encoding errors
        // These will be thrown also if the header is not forced
        $this->getCharsetGuard()->forceCharset($this->firstLinesRaw(), $this->convertFrom);

        // If we can get here the charsetGuard did not throw an exception
        if ($detectorException) {
            throw $detectorException;
        }

        $this->setHeader([]);

        return $this->header;
    }
239370
private function getStream() {

        if(!feof($this->loader->getFile())) {
            $this->stream .= fread($this->loader->getFile(), $this->loader->getBytes());
            return true;
        }

        return false;

    }
216485
public function stream()
	{
		$fp = fopen("php://memory", 'r+');
		fwrite($fp, $this->output());
		rewind($fp);
		return $fp;
	}
1138651
protected function getStreamsArray()
    {
        $content = Psr7\stream_for();
        $this->writePartContentTo($content);
        $content->rewind();
        $streams = [ $this->streamFactory->newHeaderStream($this->part), $content ];

        /**
         * @var ParentHeaderPart
         */
        $part = $this->part;
        if ($part instanceof ParentHeaderPart && $part->getChildCount()) {
            $streams = array_merge($streams, $this->getBoundaryAndChildStreams($part));
        }

        return $streams;
    }
801595
protected function resolveFileHeader()
    {
        if ($this->fileHeader) {
            return $this->fileHeaderOffset;
        }

        $this->streamReader->reset(0);
        $offset = false;
        $maxIterations = 1000;
        while (true) {
            $buffer = $this->streamReader->getBuffer(false);
            $offset = \strpos($buffer, '%PDF-');
            if ($offset === false) {
                if (!$this->streamReader->increaseLength(100) || (--$maxIterations === 0)) {
                    throw new PdfParserException(
                        'Unable to find PDF file header.',
                        PdfParserException::FILE_HEADER_NOT_FOUND
                    );
                }
                continue;
            }
            break;
        }

        $this->fileHeaderOffset = $offset;
        $this->streamReader->setOffset($offset);

        $this->fileHeader = \trim($this->streamReader->readLine());
        return $this->fileHeaderOffset;
    }
1113647
public function getAttachmentPdf()
    {
        $response = $this->api->get(
            $this->url() . '/attachment.pdf',
            null,
            'application/json'
        );

        return base64_decode($response->data->content);
    }
938002
protected function localFileStream() {

    $tmp = fopen('php://temp', 'rw');
    fwrite($tmp, $this->content(), $this->contentLength());
    rewind($tmp);

    return $tmp;
  }
93697
public function stream()
    {
        $stream = fopen($this->file, 'r');

        $stream = $stream === false ? null : $stream;

        return new Stream($stream);
    }
927211
public function getBuffer()
    {
        $currentPos = $this->getPosition();
        $this->setPosition(0, SEEK_SET);
        $buffer = stream_get_contents($this->stream);
        $this->setPosition($currentPos, SEEK_SET);
        return $buffer;
    }
648
public function ParsedContent() {
		$formatter = $this->getFormatter();
		$content = $formatter->formatContent($this);

		// purify the output - we don't want people breaking pages if we set purify=true
		if (self::$purify_output) {
			include_once SIMPLEWIKI_DIR . '/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier.auto.php';
			$purifier = new HTMLPurifier();
			$content = $purifier->purify($content);
			$content = preg_replace_callback('/\%5B(.*?)\%5D/', array($this, 'reformatShortcodes'), $content);
		}

		return $content;
	}
994046
protected function rawText() {
        if (is_null($this->untilTag)) {
            return $this->text();
        }
        $sequence = '</' . $this->untilTag . '>';
        $txt = $this->readUntilSequence($sequence);
        $this->events->text($txt);
        $this->setTextMode(0);
        return $this->endTag();
    }
649942
public function getFileStream() {
		$stream = new \FAL\FileStream();
		$pt = $stream->getProtocolName();
		file_put_contents($path = $pt.'://'.$this->file,$this->getContent());
		return $path;
	}
425344
public PdfStream getFullFontStream() throws IOException, DocumentException {
        if (cff) {
            return new StreamFont(readCffFont(), "Type1C", compressionLevel);
        }
        else {
        	byte[] b = getFullFont();
        	int lengths[] = new int[]{b.length};
        	return new StreamFont(b, lengths, compressionLevel);
        }
    }
377920
public function getContent() {

            if($this->isSeekable())
                $this->rewind();

            if (!$this->isReadable() || ($contents = stream_get_contents($this->stream)) === false) {
                throw new \RuntimeException('Could not get contents of not readable stream');
            }

            return $contents;

        }