How to see if PDFXCView is processing something?

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

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

Post Reply
magthenop
User
Posts: 43
Joined: Tue Sep 07, 2010 8:35 am

How to see if PDFXCView is processing something?

Post by magthenop » Thu Nov 25, 2010 10:23 am

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.

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

Re: How to see if PDFXCView is processing something?

Post by Tracker Supp-Stefan » Thu Nov 25, 2010 10:38 am

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

magthenop
User
Posts: 43
Joined: Tue Sep 07, 2010 8:35 am

Re: How to see if PDFXCView is processing something?

Post by magthenop » Thu Nov 25, 2010 12:34 pm

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.

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1923
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: How to see if PDFXCView is processing something?

Post by Vasyl-Tracker Dev Team » Thu Nov 25, 2010 1:51 pm

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...
Vasyl Yaremyn
Tracker Software Products
Project Developer

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

magthenop
User
Posts: 43
Joined: Tue Sep 07, 2010 8:35 am

Re: How to see if PDFXCView is processing something?

Post by magthenop » Fri Nov 26, 2010 6:15 am

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;

magthenop
User
Posts: 43
Joined: Tue Sep 07, 2010 8:35 am

Re: How to see if PDFXCView is processing something?

Post by magthenop » Fri Nov 26, 2010 10:08 am

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:

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

Re: How to see if PDFXCView is processing something?

Post by Tracker Supp-Stefan » Fri Nov 26, 2010 10:20 am

Glad to hear that magthenop!

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

Best,
Stefan

Post Reply