Home >Backend Development >PHP Tutorial >laravel - PHP Is there any extension library that can read the page number of PDF and Word?

laravel - PHP Is there any extension library that can read the page number of PDF and Word?

WBOY
WBOYOriginal
2016-10-17 09:30:011080browse

Is there any extension library for PHP that can read the page number of PDF and Word

I use laravel

It is necessary to implement the user to upload files and read how many pages there are in the file.

Reply content:

Is there any extension library for PHP that can read the page number of PDF and Word

I use laravel

It is necessary to realize the user uploading the file and reading the number of pages in the file.

Word can use phpword
For PDF:

<code>function count_pages($pdfname) {
  $pdftext = file_get_contents($pdfname);
  $num = preg_match_all("/\/Page\W/", $pdftext, $dummy);
  return $num;
}</code>

Other solutions to pdf are also available on http://stackoverflow.com/ques...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn