Page 1 of 1

How to see if PDFXCView is processing something?

Posted: Thu Nov 25, 2010 10:23 am
by magthenop
Hi!

When I load a bunch of images into the pdf viewer, how can I tell when it has done this and is ready?
Beqause for example I get an OLE error 82130001 if I try the set the Thumbnail pane visible before all is done with the loading and so on.
If would be nice to have a state propery or something alike to check.

Re: How to see if PDFXCView is processing something?

Posted: Thu Nov 25, 2010 10:38 am
by Tracker Supp-Stefan
Hello magthenop,

If you are using NewDocumentFromImages on success you will receive the unique document identifier of the newly created document in DataOut, so you should be checking for when this newDocID is set, and there is always the OnEven method to use :D

Code: Select all

// create empty IPDFXCargs object
IPDFXCargs args;
DoVerb(NULL, ".ARGS", dataIn, dataOut, 0);
args = (IPDFXCargs)dataOut;
dataOut = NULL;
...
// create input files list
args.Add("C:\image1.jpg");
args.Add("C:\image2.png");
args.Add("C:\image3.tiff");
...
// create new document from the images
DoVerb(NULL, "NewDocumentFromImages", dataIn, dataOut, 0);
newDocID = dataOut;
Best,
Stefan

Re: How to see if PDFXCView is processing something?

Posted: Thu Nov 25, 2010 12:34 pm
by magthenop
I am using the NewDocumentFromImage, but when I then try to Show the Thumbnail pane after this command I get an OLE error, and I asume thats beqause the PDFXCView is not "ready" to recieve this command at that stage.

Re: How to see if PDFXCView is processing something?

Posted: Thu Nov 25, 2010 1:51 pm
by Vasyl-Tracker Dev Team
Hi, magthenop.
... but when I then try to Show the Thumbnail pane
Please give us the simple example code for this action. It is possible that there are some errors in your code...

Re: How to see if PDFXCView is processing something?

Posted: Fri Nov 26, 2010 6:15 am
by magthenop
In essens this is whats going on:

Code: Select all

  Try
    PDFRitning.DoVerb('', 'ExecuteCommand', 'NewDocumentFromImage', DataOut, 0);
  except
    on ex : EOleException do Begin
      ShowErrorMessage('NewDocumentFromImage, OppnaBilder',ex);
    End;
  end;
If success, run this:

Code: Select all

    Try
      PDFRitning.SetProperty('Commands[#32620].State','Offline',0);    // Stäng av Select Text
    except
      on ex : EOleException do Begin
        ShowErrorMessage('Stäng av Select Text, FixaBilden',ex);
      End;
    end;


    Try
      PDFRitning.SetProperty('Commands[#32614].State','Offline',0);    // Stäng av Snapshot tool
    except
      on ex : EOleException do Begin
        ShowErrorMessage('Stäng av Snapshot tool, FixaBilden',ex);
      End;
    end;

    Try
      PDFRitning.SetProperty('View.Bars[#32925].Visible',1,0);    // Zoom
    except
      on ex : EOleException do Begin
        ShowErrorMessage('Zoom, FixaBilden',ex);
      End;
    end;


    Try
      PDFRitning.SetProperty('Commands[#36346].State','Offline',0);    // Avståndsmätning
    except
      on ex : EOleException do Begin
        ShowErrorMessage('Avståndsmätning, FixaBilden',ex);
      End;
    end;


    If FinnsKommentarer=True Then Begin
      Try
        PDFRitning.SetDocumentProperty(DocId,'View.Panes["Comments"].Visible',1,0);    // Visa Comments panel
      except
        on ex : EOleException do Begin
          ShowErrorMessage('Visa Comments panel, FixaBilden',ex);
        End;
      end;
    End;

      Try
        PDFRitning.SetDocumentProperty(DocId,'View.Panes["Thumbnails"].Visible',1,0);    // Visa Tummnaglar för sidor panelen
      except
        on ex : EOleException do Begin
          ShowErrorMessage('Visa Tummnaglar för sidor panelen, FixaBilden',ex);
        End;
      end;


    Try
      PDFRitning.SetProperty('Commands[#36350].State','Offline',0);    // Stäng av Summering av kommentarer
    except
      on ex : EOleException do Begin
        ShowErrorMessage('Stäng av Summering tool, FixaBilden',ex);
      End;
    end;

Re: How to see if PDFXCView is processing something?

Posted: Fri Nov 26, 2010 10:08 am
by magthenop
Hi!

After updating to the new 2.5.188 this problem har gone away. :mrgreen:

Did also notice that there are two things in the new version that I could use, namely ContentMonitor and ContentReady to wait until an openening of a document is complete. :idea:

Re: How to see if PDFXCView is processing something?

Posted: Fri Nov 26, 2010 10:20 am
by Tracker Supp-Stefan
Glad to hear that magthenop!

And Kudos to our dev guys for the new build! :)

Best,
Stefan