public function getPdfVersion()
    {
        $this->resolveFileHeader();

        if (\preg_match('/%PDF-(\d)\.(\d)/', $this->fileHeader, $result) === 0) {
            throw new PdfParserException(
                'Unable to extract PDF version from file header.',
                PdfParserException::PDF_VERSION_NOT_FOUND
            );
        }
        list(, $major, $minor) = $result;

        $catalog = $this->getCatalog();
        if (isset($catalog->value['Version'])) {
            $versionParts = \explode('.', PdfName::unescape(PdfType::resolve($catalog->value['Version'], $this)->value));
            if (count($versionParts) === 2) {
                list($major, $minor) = $versionParts;
            }
        }

        return [(int) $major, (int) $minor];
    }
public function getPdfVersion()
    {
        $this->resolveFileHeader();

        if (\preg_match('/%PDF-(\d)\.(\d)/', $this->fileHeader, $result) === 0) {
            throw new PdfParserException(
                'Unable to extract PDF version from file header.',
                PdfParserException::PDF_VERSION_NOT_FOUND
            );
        }
        list(, $major, $minor) = $result;

        $catalog = $this->getCatalog();
        if (isset($catalog->value['Version'])) {
            $versionParts = \explode('.', PdfName::unescape(PdfType::resolve($catalog->value['Version'], $this)->value));
            if (count($versionParts) === 2) {
                list($major, $minor) = $versionParts;
            }
        }

        return [(int) $major, (int) $minor];
    }
public function getPdfVersion ( ) { $ this -> resolveFileHeader ( ) ; if ( \ preg_match ( '/%PDF-(\d)\.(\d)/' , $ this -> fileHeader , $ result ) === 0 ) { throw new PdfParserException ( 'Unable to extract PDF version from file header.' , PdfParserException :: PDF_VERSION_NOT_FOUND ) ; } list ( , $ major , $ minor ) = $ result ; $ catalog = $ this -> getCatalog ( ) ; if ( isset ( $ catalog -> value [ 'Version' ] ) ) { $ versionParts = \ explode ( '.' , PdfName :: unescape ( PdfType :: resolve ( $ catalog -> value [ 'Version' ] , $ this ) -> value ) ) ; if ( count ( $ versionParts ) === 2 ) { list ( $ major , $ minor ) = $ versionParts ; } } return [ ( int ) $ major , ( int ) $ minor ] ; }
Get the PDF version.

@return int[] An array of major and minor version.
@throws PdfParserException
Get the PDF version .