public function countPagesInPdf( $path_to_pdf ) {
		if ( ! file_exists( $path_to_pdf ) ) {
			throw new \InvalidArgumentException( "File not found: $path_to_pdf" );
		}

		$output = [];
		$return_var = 0;
		$command = PB_PDFINFO_COMMAND . ' ' . escapeshellarg( $path_to_pdf ) . ' | awk \'/Pages/ {print $2}\'';

		exec( $command, $output, $return_var ); // @codingStandardsIgnoreLine

		return (int) $output[0];
	}
public function countPagesInPdf( $path_to_pdf ) {
		if ( ! file_exists( $path_to_pdf ) ) {
			throw new \InvalidArgumentException( "File not found: $path_to_pdf" );
		}

		$output = [];
		$return_var = 0;
		$command = PB_PDFINFO_COMMAND . ' ' . escapeshellarg( $path_to_pdf ) . ' | awk \'/Pages/ {print $2}\'';

		exec( $command, $output, $return_var ); // @codingStandardsIgnoreLine

		return (int) $output[0];
	}
public function countPagesInPdf ( $ path_to_pdf ) { if ( ! file_exists ( $ path_to_pdf ) ) { throw new \ InvalidArgumentException ( "File not found: $path_to_pdf" ) ; } $ output = [ ] ; $ return_var = 0 ; $ command = PB_PDFINFO_COMMAND . ' ' . escapeshellarg ( $ path_to_pdf ) . ' | awk \'/Pages/ {print $2}\'' ; exec ( $ command , $ output , $ return_var ) ; // @codingStandardsIgnoreLine return ( int ) $ output [ 0 ] ; }
Count the pages in a PDF file

@param $path_to_pdf

@return int
Count the pages in a PDF file