Getting fast PDF page count (without opening file)?

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?

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.

Similar Messages

  • View page size without opening file

    Is there a way to view the page size of a pdf document without actually opening the file?
    My use is in a print shop as a part of a preflight check. I often recieve artwork setup to the wrong page size, and it often arrives as part of a dump of 30+ files. At the moment I am opening each file, and checking the document properties in viewer to get the page size. I've tried adding a "dimensions" column into windows explorer, but that doesn't work on pdf's.

    The dimensions of pages in a PDF file aren't stored in the document metadata - the only way to find them out is to open the file.

  • Access PDF Security properties without opening files?

    I have a document library of around 12,000 files which will be sold through a document delivery website. To counter copying etc. we are using a PDF Stamper program to individualise documents at purchase.
    Our problem is that we have been supplied a mix of Password Protected and not Protected files.
    Is there a way (or a utility) that can scan the library and report which documents are so Protected?
    Many thanks.
    Brian

    The ignorance may be mine. Try var re = /Text\s\(\xFE\xFF\x00(.+)/g;
    What that 'says' is look for  Text(one whitespace)(the ascii code in hex for the next 3 chars)then remember/store the rest of the line.
    I first looked at a sample PSD using a hexeditor to see if I could find a pattern to search. As you pointed out in the frist post, text appears a lot of times and I didn't have any luck finding the pattern that way.
    So next I opened the sample with a text editor and found this:(nb I have replace the x00 chars with '00' here so the pattern can be seen)
    <<
         /EngineDict
         <<
              /Editor
              <<
                   /Text (þÿ00M00y00T00e00x00t00
    I think the text is stored in what is called a zero pad text. Which is why if a match is found it loops through the string to remove the x00 chars.
    I would have thought it would work with the RegExp I posted. But I changed to re to match as decribed above incase the space or þÿ is the problem.
    The only other thing I can think of is I tested this on a PC. If you are on a Mac you might want to look at a pad with a texteditor to see if the þÿ part looks the same. I know that the difference in the way the byte order is read can be a problem. I wouldn' t think so here but...
    Also as I noted it runs slow on my maching after the first run. The first run is quick. Every run after that is much slower. It may be just my system but it this might be very slow scanning a folder in a loop.
    Mike

  • How can I get a total page count of a PDF before placing every page in the PDF?

    Before the [long] spiel, I'm using javascript in InDesign CS3.
    I'd like to create a script that places a multiPage PDF in any number of different impositions. (saddle stitch, 4up signatures, 16up signatures etc.)
    I've easily created a script that iterates through a PDF and places it into a new document as (4,1|2,3), (8,5|6,7) etc, which works for printing in duplex, folding each page in half, and gluing the resulting spines to make a simple thick book (for PDFs with more than, say, 64 pages).
    However, the next step is to re-write the script to create a saddle stitch document (16,1|2,15), (14,3|4,13) ... (10,7|8,9). For this I need to know how many pages there are in the PDF before I start placing the PDF pages, and then making the new document [int((PDFpages+3)/4)] pages long.
    Is there a simple way to get the count of PDFpages without going through a loop and placing the next page from the PDF until the placed page number equals the first page number?
    This way seems wasteful:
    var totPDFPages = 1;
    app.pdfPlacePreferences.pageNumber = totPDFPages;
    myPDFPage = sheetFront.place(File(srcPDF), [0,0])[0];
    var pdfFirstPage = myPDFPage.pdfAttributes.pageNumber;
    while (doneCounting == false) {
    totPDFPages += 1;app.pdfPlacePreferences.pageNumber = totPDFPages;
    myPDFPage = sheetFront.place(File(srcPDF), [0,0])[0];
    if (myPDFPage.pdfAttributes.pageNumber == pdfFirstPage) {
    totPDFPages -=1;
    doneCounting = true;
    alert("PDF has " + totPDFPages + " pages!");exit();
    myPDFPage.remove();
    NB. Javascript above *hasn't* been run, but should look similar once debugged.
    The only thing I've though of to relieve the sheer duplication of placing the PDF twice (once for the count, and once for the imposition), is to create an array of impoPages[counter]=myPDFPage, and then shuffle the pages referenced by the array to the correct sheet and position.
    It'd be much easier to be able to assign pageCount = File(srcPDF).pageCount !!!
    Thanks for any help/tips or even a simple "What are you smoking, man!?"
    Cheers,
    Jezz

    this will get almost all pdf pages count.
    jxswm
    function getPDFPageCount(f){
      if(f.alias){f = f.resolve();}
      if(f == null){return -1;}
      if(f.hidden){f.hidden = false;}
      if(f.readonly){f.readonly = false;}
      f = new File(f.fsName);
      f.encoding = "Binary";
      if(!f.open("r","TEXT","R*ch")){return -1;}
      f.seek(0, 0); var str = f.read(); f.close();
      if(!str){return -1;}
      //f = new File(Folder.temp+"/123.TXT");
      //writeFile(f, str.toSource()); f.execute();
      var ix, _ix, lim, ps;
      ix = str.indexOf("/N ");
      if(ix == -1){
        var src = str.toSource();
        _ix = src.indexOf("<< /Type /Pages /Kids [");
        if(_ix == -1){
          ps = src.match(/<<\/Count (\d+)\/Type\/Pages\/Kids\[/);
          if(ps == null){
            ps = src.match(/obj <<\\n\/Type \/Pages\\n\/Count (\d+)\\n\/Kids \[/);
            if(ps == null){
              ps = src.match(/obj\\n<<\\n\/Type \/Pages\\n\/Kids \[.+\]\\n\/Count (\d+)\\n\//);
              if(ps == null){return -1;}
              lim = parseInt(ps[1]);
              if(isNaN(lim)){return -1;}
              return lim;
            lim = parseInt(ps[1]);
            if(isNaN(lim)){return -1;}
            return lim;
          lim = parseInt(ps[1]);
          if(isNaN(lim)){return -1;}
          return lim;
        ix = src.indexOf("] /Count ", _ix);
        if(ix == -1){return -1;}
        _ix = src.indexOf(">>", ix);
        if(_ix == -1){return -1;}
        lim = parseInt(src.substring(ix+9, _ix));
        if(isNaN(lim)){return -1;}
        return lim;
      _ix = str.indexOf("/T", ix);
      if(_ix == -1){
        ps = str.match(/<<\/Count (\d+)\/Type\/Pages\/Kids\[/);
        if(ps == null){return -1;}
        lim = parseInt(ps[1]);
        if(isNaN(lim)){return -1;}
        return lim;
      lim = parseInt(str.substring(ix+3, _ix));
      if(isNaN(lim)){return -1;}
      return lim;

  • Getting java.io.IOException: Too many open files+ClassNotFoundException

    Dear All
    We have a web application deployed on Rational Application Developer 6.0 (Operating System is Windows 2000 professional) our users are randomly getting java.io.IOException: Too many open files+ClassNotFoundException when they click on some servlet or jsp link, but they are getting this error randomly for example when they click some link they may get these exceptions but refreshing page or clicking once again on same link executes servlet successfully.If anyone could help on this topic we will be grateful
    Thanks

    I think this these two exceptions are occuring in differrent environment
    java.io.IOException is occuring under heavy load to web server its stack trace is as follows:
    JSPG0225E: An error occurred at line: 2 in the statically included file: /SessionCheck.jsp
    JSPG0093E: Generated servlet error from file: /Admin/AdminInsuranceCertificates.jsp
    E:\WebSphere_6\AppServer\profiles\AUSECert\temp\centraNode04\server1\AUSECert\Vero.war\Admin\_AdminInsuranceCertificates.java:259: cannot access com.bplus.natmar.LoginDetails
    bad class file: E:\WebSphere_6\AppServer\java\jre\lib\core.jar(java/io/Writer.class)
    unable to access file: E:\WebSphere_6\AppServer\profiles\AUSECert\installedApps\centraNode04Cell\AUSECert.ear\Vero.war\WEB-INF\classes\com\bplus\natmar\LoginDetails.class (Too many open files)
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    (source unavailable)
    1 error
    ]: com.ibm.ws.jsp.JspCoreException: JSPG0049E: /Admin/AdminInsuranceCertificates.jsp failed to compile :
    this error always occurs in reference to logindetails class this clas is used to make a session check on different roles in our project for e.g., user having end user role should not be able to log in as a user having admin role
    we have included a sessioncheck.jsp in our every jsp page in this jsp we have simply used logindetails class as useBean and called its getresource() method
    above stacktrace is from our live application server
    while testing same project on our local system we are not getting too many open files exception but we are getting following ClassNotFoundException
    [11/30/05 17:11:42:797 EST] 0000004a SystemOut O SELECT count(*) as NoofRecs FROM resourcerolebindings WHERE ResourceName = 'mainEdit.jsp' and IsEndUser=1
    [11/30/05 17:12:50:891 EST] 000001eb SystemOut O SELECT count(*) as NoofRecs FROM resourcerolebindings WHERE ResourceName = 'InsuranceCertificates.jsp' and IsEndUser=1
    [11/30/05 17:17:40:828 EST] 0000008d SystemOut O AppURL is: http://www.VeroECert.com/Vero/indexU.jsp
    [11/30/05 17:17:58:141 EST] 0000008b SystemOut O SELECT count(*) as NoofRecs FROM resourcerolebindings WHERE ResourceName = 'InsuranceCertificates.jsp' and IsEndUser=1
    [11/30/05 17:20:41:703 EST] 00000034 ServletWrappe E SRVE0026E: [Servlet Error]-[com.servlet.UserHelpServlet]: java.lang.ClassNotFoundException: com.servlet.UserHelpServlet
         at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java(Compiled Code))
         at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java(Compiled Code))
         at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
         at java.beans.Beans.instantiate(Beans.java:202)
         at java.beans.Beans.instantiate(Beans.java:63)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper$3.run(ServletWrapper.java:1384)
         at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1312)
         at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:84)
         at com.ibm.ws.webcontainer.extension.InvokerExtensionProcessor.handleRequest(InvokerExtensionProcessor.java:238)
         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
         at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java(Compiled Code))
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java(Compiled Code))
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java(Compiled Code))
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java(Compiled Code))
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
    this error is occuring on concurrent clicks suppose three users click on same button then it is possible that one user gets correct output while other users experience this exception
    Also one more point we are not using web.xml for calling servlets we are directly calling it giving its full path.
    Thanks

  • How do I reinstall iWeb 3.0.3?  I inadvertently opened an html file of my website and tried to open it with iWeb '09. I get a message saying "Can't open file" etc., etc. I've tried reinstalling the updated version. Iweb will not open.

    How do I reinstall iWeb 3.0.3?  I inadvertently opened an html file of my website and tried to open it with iWeb '09. I get a message saying “Can’t open file” etc., etc. I’ve tried reinstalling the updated version. Iweb will not open.

    Delete the iWeb preference file, com.apple.iWeb.plist, that resides in your Home/Library/Preferences folder. Then launch iWeb and see if it opens. 
    What happened was trying to open the html file reset the file path that iWeb saves in its preference file to tell it where to go when you launch iWeb.  Deleting the pref file and launching iWeb creates a new file and iWeb looks in your Users/Home/Library/Application Support/iWeb folder for the Domain.sites2 file it uses to create your site.
    OT

  • How to get the Report Page count using crystal reports 2008

    Hi,
    I  have to implement a business logic where in i will have to display the no. of pages generated for the report
    Say for e.g. crytal report that's generated spans 25 pages in the report.
    Then i will have to display a message to the user after the report generation something like  "25 Pages generated"
    So, how would i get this report page count so that i can fetch the value and display the same to the user.
    Any sample code snippet would be of great help.
    Thanks in Advance
    Regards,
    Ramnath

    Hi,
    I am using crystal reports 2008 and i  visited the link forwarded in your previous mail and got the solution for getting the lastpagenumber of the report.
    nPages = crReport.FormatEngine.GetLastPageNumber(New CrystalDecisions.Shared.ReportPageRequestContext)
    but, i don't find FormatEngine  property for ReportDocument object.
    I just wanted to know whether this property is availale in crystal reports 2008 or should i even install any service packs for this.
    Please find below the namespaces that importing in my class
    Imports System.Windows.Forms
    Imports System.Drawing.Printing
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared
    Imports CrystalDecisions.Windows.Forms
    Imports CrystalDecisions.CrystalReports.ViewerObjectModel
    Imports CrystalDecisions.Shared.ReportPageRequestContext
    Please let me know how can i get the formatEngine property for reportdocument object
    Thanks in Advance
    Regards,
    Ramnath

  • When I try to open iweb I get the following message: Can't open file "~/Sites/NAVIGATOR/index.html." How do I fix this? Using 10.6.3 soon to be 10.6.6 and then Lion.

    When I try to open iweb I get the following message: Can’t open file “~/Sites/NAVIGATOR/index.html.” How do I fix this? Using 10.6.3 soon to be 10.6.6 and then Lion. I have never opened the product before and have had it on the computer since new.

    Go into your Users/Home/Library/Application Support/iWeb folder and see if there's a file titled Domain.sites.  If there is double click on it and see if iWeb opens.
    If there is no Domain file there do the following:
    delete the iWeb preference files, com.apple.iWeb.plist and com.apple.iWeb.plist.lockfile, that resides in your Home() /Library/Preferences folder.
    go to your Home()/Library/Caches/com.apple.iWeb folder and delete its contents.
    Click to view full size
    launch iWeb and try again.
    OT

  • When i down load a book on to my ebook reader i get a message saying "failed to open file"

    When I down load a book on to my ebook reader and try to open it I get a message saying "failed to open file"

    Restart your Mac and the scanner then try scanning.
    By the way, there's an alternative to using the Canon scanner software.
    Use the pre installed Image Capture app in your Applications folder instead >  Mac Basics: Using a scanner

  • How can I get just a page border without having a border around every paragraph?

    How can I get just a page border without having a border around every paragraph? I just want a border around the perimeter of the page.

    Assuming you are using Pages 5, you haven't said:
    1. Select multiple paragraphs > Text > Layout > Borders & Rules > choose a line > select a thickness > select the 4th Positon (all around) > Offset
    or
    2. Inseert a rectangular shape > Resize to suit > Format > Fill > No fill > Border > Line > select thickness/color > Arrange > Stay on Page > Text Wrap > None
    If you want that on every page
    Menu > Arrange > Section Masters > Move Object to Section Master
    Pages will not be able to use fonts that are on your PC (I suppose?) if it doesn't have them. Obviously.
    Just as your PC will not be able to use the Mac's fonts.
    Peter

  • Since I signed up for icloud, I can't get into my iweb application. I get the following message   Can't open file "/Volumes/pnoon1/Band Stufff/Domain.sites2."

    Since I signed up for icloud, I can't get into my iweb application. I get the following message 
    Can’t open file “/Volumes/pnoon1/Band Stufff/Domain.sites2.”
    Any one have any clues ????

    Hi!
    I encountered a problem a few weeks ago which is a bit like yours. In my case my Apple ID stopped working after I upgraded to Mountain Lion. I finally found out it was because of the fact that my Apple ID has in fact been an alias within my much older MobileMe/iCloud account. And they weren't able to merge or reset the account at first. It took me a lot of mails and a few calls to get them to resetting the account and changing my Apple ID (for the Apple Store, iTunes, etc.) to a different, non-iCloud related email adress.
    Anyway, maybe you can call the Apple Support and kindly ask them to reset the password for this ominous @me.com account so you can finally start using it.
    Did you try logging into iCloud using your adress with the appendix @me.com because not everybody has got the @icloud.com ending yet. Technically it's no problem to create a new iCloud account. I can understand though that you'd like to get "your name" back .

  • Saving Adobe PDF Page Size without Admin Rights?

    Ok to get started, to define the limits of my environment for replication:
    I'm using Windows XP SP3 and have tried Adobe Acrobat 8, 9, and X, my computer is on a network at work, and my user rights are limited.
    Open Printing Preferences, Click Add...
    The "Add Custom Paper Size" window appears, give a new name and define sizes of the paper.
    Lets say I'm printing to a large format say 36" Tall by 108" Long (3ft x 9ft)
    Click Add/Modify, the window goes away, focus again on Adobe PDF Printing Preferences. Click the drop down box for Adobe PDF Page Size:
    The page size I just added to the list is not there!
    The solution to the this problem is to have Administrative Rights to your machine in order to add custom paper sizes.
    Note to Adobe Acrobat Programmers/Designers: please redevelop this feature to allow users to add paper sizes without Power User or Admin Rights. In a secure network these rights are not easily given out to every Dick and Jane that uses your software.

    Interesting post, and for once, something one should be able
    to work with.
    I have a similar problem:
    We're using a software distribution tool to install
    msi-packages via rpc. Trying to distribute the latest flashplayer
    works fine, but the users can't open flash-files, whether with
    firefox nor internetexplorer tried 6 and 7 with latest patches.
    I've found two possible ways to install a flashplayer plugin,
    but both require manual input, which is just not possible for
    >100 Clients. just to mention: clean registry and then install
    with admin rights or just run the installer with admin rights from
    the local machine.
    Another problem is, that our company security policy
    prohibits from using admin-rights for most installations.
    is there any workaround?
    regards
    Matthias Hilpert
    ps: /sticky or at least a FAQ :-)

  • Pages can´t open files saved in iCloud

    I can´t open any file save to iCloud
    I tried a workaraound:
    I couldn´t open a file save to iCloud from my iPad.
    I opened it from icloud.com and downloaded it to my iMac.
    Opened the downloaded file, and everything semed ok.
    I then closed the dokument and opened the file on my ipad again. Made som editing before I closed the dokument.
    Then I tried to open it again in Pages on my iMac, but couldent open it.
    Translated: Couldn´t open the file ".... ..."
    I also tried to open a file saved to icloud (without opening it on other machines and devises). Pages couldn´t open those files either...
    Can sombody help me?

    Possibly you have 2 versions of Pages on your Mac.
    Pages 5.2 is in your Applications folder.
    Pages '09/'08 is in your Applications/iWork folder.
    You are alternately opening the wrong versions.
    Pages '09/'08 can not open Pages 5 files and you will get the warning that you need a newer version.
    Pages 5.2 can open Pages '09 files but may damage/alter them. It can not open Pages '08 files at all.
    Older versions of Pages 5 can not open files from later versions of Pages 5.
    Once opened and saved in Pages 5 the Pages '09 files can not be opened in Pages '09.
    Anything that is saved to iCloud and opened in a newer version of Pages is also converted to Pages 5 files.
    All Pages files no matter what version and incompatibility have the same extension .pages.
    Pages 5 files are now only compatible with themselves on a very restricted set of hardware, software and Operating Systems and will not transfer correctly on any other server software than iCloud.
    Apple has removed over 110 features from Pages 5 and added many bugs.
    Peter

  • How do I download pdfs from link without opening first in Safari?

    I am running OS 10.7.2 and browse with Safari 5.1.2.  I download PDF files routinely for my work.  In previous versions of Safari (with OS 10.5.x), clicking a link to download a PDF led to the PDF immediately downloading and then opening in Adobe Acrobat Pro.  Since upgrading to current system and Safari, I can no longer do that.  Clicking on PDF links opens in Safari, and then I have to find and click Safari's download button, and then I have to go to the downloads folder and click to open the document.  Does anyone know how to bypass this opening feature and get Safari to just download and then get the pdf to instantly open like it used to?  I am finding myself moving to Firefox, which I don't like as well and don't know as well, because it doesn't interfere with PDF docs. 
    Any solutions out there?

    Thanks for the suggestion, but those are the settings I'm already using.  Unfortunately, the various websites I visit don't respond uniformly to control-click, and choosing to download a file from that menu often just downloads an HTML of the page rather than the pdf doc itself.  I find shift-option-click works more often than other key combos, but I still have to then go to the downloads folder and manually open the file. 
    You may be right about Firefox being my only option.  Thanks for the suggestions.

  • Attaching ONLY a PDF icon, not the open file to a mail message.

    I recall that I once found a Menu item for limiting the attachment of a PDF to its icon only and NOT the opened file. I can't find it now. Any idea welcome.

    I had it and now it is gone.  Don't know exactly when but recently (OSX 10.8.5).  Perhaps I am not the only one with this experience.  It seemed to work for all attachments too ala MS Exchange.  Changing to plain text did not help me.
    Does the recipient get it the same way it is sent - not having tested?  Yes I'm lazy.
    Is there a way to set attachment as icon by default without a third party tool?

Maybe you are looking for