Is importAnXFDF and flattenPages synchronized

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

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

RudolfErnst
User
Posts: 73
Joined: Tue Oct 14, 2008 2:14 pm

Is importAnXFDF and flattenPages synchronized

Post by RudolfErnst »

In the past (Nov 07, 2008) i opened a new topic "Is OpenDocument synchronized". I wanted to know whether OpenDocument is synchronized In other words: is the document completely displayed on the screen when the method returns S_OK or does it just trigger the rendering and returns immediately. If it's asynchron is there another method to determine if rendering is complete (isLoaded(), isFinished()??). I use Eclipse RCP and the ActiveX control of PDF-XChange.

Vasyl Yaremyn told me that I have tu use Documents.ContentMonitor and ask for the property Documents[<ID>].ContentReady. This worked perfect. Now I have a similar question: Is importAnXFDF and flattenPages synchronized?. Is there a property I can monitor to get informed that importAnXFDF (and also flattenPages) is ready, that means rendering is finished and PDFXChange is ready for the next command.

kind regards
Rudi
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Is importAnXFDF and flattenPages synchronized

Post by Stefan - PDF-XChange »

Hi Rudi,

I've passed this question to Vasyl again - and he should reply here shortly!

Best,
Stefan
RudolfErnst
User
Posts: 73
Joined: Tue Oct 14, 2008 2:14 pm

Re: Is importAnXFDF and flattenPages synchronized

Post by RudolfErnst »

Hello Stefan,

did you hear anything from Vasyl.

Best regards
Rudi
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Is importAnXFDF and flattenPages synchronized

Post by Stefan - PDF-XChange »

Hi Rudi,

Apologies for the delay! Nope I have not heard anything - but will ask again and hope to have a reply for you a bit later today.

Best,
Stefan
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Is importAnXFDF and flattenPages synchronized

Post by Vasyl - PDF-XChange »

Hi Rudi,

Sorry for delay again but we are very busy with new version of viewer..

For your case if you wanted to known when rendering of pages is finished you may use the similar method:

Code: Select all

SetDocumentProperty(docId, "ContentMonitor", "On");
...
foreach (operationsQueue)
{
  call operationsQueue[i]->Run(); // importAnXFDF/flattenPages
  WaitForContentReadyFlagWithMessageLoop();
}
...
bool bContentReady = true;
UpdateContentReadyFlag()
{
    bContentReady = true;
    GetDocumentProperty(docId, "ContentReady", out bContentReady);
}
...
WaitForContentReadyFlagWithMessageLoop()
{
    UpdateContentReadyFlag(); 
    // windows messages pumping with checking the 'ContentReady' flag
    while (!bContentReady)
    {
       if (PeekMessage(msg))
           DispatchMessage(msg);
       else
            Sleep(100);
    }
}
....
youreventhandler OnEvent(type, name)
{
    if ((type == PXCVA_OnPropertyChanged) || (StrStr(name, ".ContentReady") == 0))
    {
        UpdateContentReadyFlag();
    } 
}
I'm afraid but no simple way to detect when control is really idle...
In new version of SDK you will be able to catch exact 'begin/end' events of any action inside control.

Also you may try to use other option - "Performance.SyncRendering"

HTH.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.