public function countPagesInMostRecentPdf() {
		$files = \Pressbooks\Utility\group_exports();

		if ( empty( $files ) ) {
			return 0;
		}

		foreach ( $files as $date => $exports ) {
			foreach ( $exports as $file ) {
				$file_extension = substr( strrchr( $file, '.' ), 1 );
				if ( 'pdf' === $file_extension ) {
					$path_to_pdf = \Pressbooks\Modules\Export\Export::getExportFolder() . $file;
					break 2;
				}
			}
		}

		if ( empty( $path_to_pdf ) ) {
			return 0;
		}

		try {
			return $this->countPagesInPdf( $path_to_pdf );
		} catch ( \Exception $e ) {
			return 0;
		}
	}
public function countPagesInMostRecentPdf() {
		$files = \Pressbooks\Utility\group_exports();

		if ( empty( $files ) ) {
			return 0;
		}

		foreach ( $files as $date => $exports ) {
			foreach ( $exports as $file ) {
				$file_extension = substr( strrchr( $file, '.' ), 1 );
				if ( 'pdf' === $file_extension ) {
					$path_to_pdf = \Pressbooks\Modules\Export\Export::getExportFolder() . $file;
					break 2;
				}
			}
		}

		if ( empty( $path_to_pdf ) ) {
			return 0;
		}

		try {
			return $this->countPagesInPdf( $path_to_pdf );
		} catch ( \Exception $e ) {
			return 0;
		}
	}
public function countPagesInMostRecentPdf ( ) { $ files = \ Pressbooks \ Utility \ group_exports ( ) ; if ( empty ( $ files ) ) { return 0 ; } foreach ( $ files as $ date => $ exports ) { foreach ( $ exports as $ file ) { $ file_extension = substr ( strrchr ( $ file , '.' ) , 1 ) ; if ( 'pdf' === $ file_extension ) { $ path_to_pdf = \ Pressbooks \ Modules \ Export \ Export :: getExportFolder ( ) . $ file ; break 2 ; } } } if ( empty ( $ path_to_pdf ) ) { return 0 ; } try { return $ this -> countPagesInPdf ( $ path_to_pdf ) ; } catch ( \ Exception $ e ) { return 0 ; } }
Count the pages in the most recent PDF export

@return int
Count the pages in the most recent PDF export