LoadFromFileAsCopy not picking up the file

  • We are using the method TWPViewPDF.LoadFromFileAsCopy in order to load a PDF file into the viewer panel of our document imaging system. The document imaging system was written in house in Delphi.

    The problem we're getting is intermittent. The user tries to load the document and it doesn't appear in the viewer. The page count is listed as being -1. This happens for most of her documents but not all. Some load ok.

    I have spent some time debugging through the code, and the load method seems to complete ok. However the GetPageCount then returns -1 and I'm not sure why. There doesn't seem to be any rhyme nor reason behind which files work and which don't.

    I tried taking a copy of one of the documents she couldn't load and trying it myself and it worked ok for me. However, I've since found files that I can't load either. She's using Windows XP and I'm using Windows 7.

    She has Adobe Reader 9.1.2m1 installed and all the documents she's trying to load are that version or earlier. I'm running v10.

    I'm at a loss to work out where I should be looking to fix this problem. Our document management system was built using Delphi XE and version 2.59.5 of WPViewPDF.

    We're using a DLLName property of 'AUTO'. Not sure what that does and where it looks for the DLLs.

    Any help would be appreciated.