2 Replies Latest reply on Feb 15, 2008 12:32 PM by Applied CD

    Getting fast PDF page count (without opening file)?

    Applied CD Level 1
      I’ve got a menu with about 100 PDFs and for various reasons I’d like to display the page count for each. I could enter the page count by hand but that becomes a maintenance nightmare as the PDFs are updated and someone (myself included) will forget to update the count. Opening each PDF in an xtra to get the page count would be too slow for 100 documents . I’ve found a dll that claims to parse the PDF header and quickly count PDF pages which might work (we’re already using dllBinder for MAPI access) although I haven’t started experimenting with it. Has anyone tried something similar? Can I parse the header with lingo/Buddy API and avoid working with the dll black box?
        • 1. Re: Getting fast PDF page count (without opening file)?
          Level 7
          I would take an approach in between the extremes you listed. Consider
          this. Make a list of all the documents, and make an automated process
          using Impressario or something to get the total pages in all 100
          documents. Save this list. It will take a bit to open and close all
          the docs, but it only need to be done once. From then on, compare to
          the saved list. Whenever a doc gets changed use your automated
          Impressario process to update the list.

          If the DLL route doesn't pan out, then that is how I would go about it.
          You;d still need to remember to update your list after every change,
          but at least it is an automatic process.
          • 2. Re: Getting fast PDF page count (without opening file)?
            Applied CD Level 1
            Thanks Mike,

            I ended up doing something similar to what you suggested. The DLL approach looked fairly straight forward but I started to get the feeling it would be polling the CD too frequently for information that never changes. In the end I thought it was better to hard code the counts rather than dynamically read them at run time.