Hello, is it possible to find out how many pages has a .PDF file? [using php, obviously]
I've been trying to do it but haven't had much luck so far, since my webserver keeps freezing when I try to read the file.

Thanks in advance for any help on this matter,
-javier

    Should we maybe figure out why you can't open the PDF file first? 😉

      Huh? by 'my webserver keeps freezing when I try to read the file' I meant when trying to read the .pdf using php. My webserver freezes because the .pdf is 23mbs large.

      anyway...

        That's what I'm saying - I would presume you'd need to open the file before you could get any information as to its length from it. That's why I suggested we figure out a way to simply open the file with PHP, then we could work on page numbering.

          Oh, sorry then, I misunderstood what you said.

          Anyway, does has anyone tried this before? to get the number of pages off a PDF file? Anything PDF to PHP related? To find out a simple way to open the file without freezing the server, as Horizon suggested.

            If you use the [man]PDF[/man] library in PHP, you can use [man]pdf_get_pdi_value/man to get the page count as explained in the user-contributed notes section in the manual.

              Write a Reply...