Too many open documents

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

AndreaCCS
User
Posts: 51
Joined: Wed Jun 16, 2010 2:54 pm

Too many open documents

Post by AndreaCCS »

We have an issue with using the viewer in a high volume automated application where we open a document, get some information and then close the document. After a variable amount of time we get an error when calling

Code: Select all

axCoPDFXcview64.OpenDocument(path, "", out documentID, (int)Interop.PDFXCviewAxLib32.PXCVA_Flags.PXCVA_NoUI);
We get

Code: Select all

System.Runtime.InteropServices.COMException (0x82132775): Exception from HRESULT: 0x82132775
   at Interop.PDFXCviewAxLib64.IPDFXCview2.OpenDocument(String SourceFileName, String OpenPassword, Int32& ID, Int32 Flags)
   at Phoenix.Common.Controls.Viewer.OpenPDF(String path) in 
Getting the error string from this HResult gives

Code: Select all

     Too many documents are already opened
When we use GetProperty("Documents.Count") this shows there are 0 documents open (as expected).

Once we get this error we can't seem to recover. Have you got any idea what is causing this or how we can handle the error better?

Thanks
Andrea
Andrea
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17948
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: Too many open documents

Post by Tracker Supp-Stefan »

Hi Andrea,

The Viewer requires a lot of handles to deal with PDF files and therefore has a build-in limit of 50 opened files at time.
So there is two possibilities:
- leak of handles (or memory?), which will prevent the Viewer from opening files properly.
- strange bug in counting the number of open files (in that case Viewer will not even try to open file).
Please send us information about the PDFXCView.exe process (see attached screenshot) and prepare a sample which will we can use to try and reproduce the problem at our end.

Regards,
Stefan
You do not have the required permissions to view the files attached to this post.