Displaying and/or Saving Snapshot  SOLVED

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

Wolfgang Weh
User
Posts: 7
Joined: Fri Feb 27, 2015 12:57 pm

Displaying and/or Saving Snapshot

Post by Wolfgang Weh »

Hello,

I would like to get the image of a snapshot when when it has been created.

What I'm doing at the moment...

To detect if a snapshot has been created I look at the mouse notifications:

Code: Select all

Case "Notifications.Mouse"
   TryGetProperty("Notifications.Mouse.msg", e.dataOut, 0)
   If ((e.dataOut IsNot Nothing) AndAlso (e.dataOut = "514")) Then   ' Left Mouse Button Up
      TryGetProperty("Notifications.Mouse.TargetName", e.dataOut, 0)
      If ((e.dataOut IsNot Nothing) AndAlso (e.dataOut = "Pages")) Then    ' Click on the PDF Page
         TryGetProperty("Tools.Active", e.dataOut, 0)
         If ((e.dataOut IsNot Nothing) AndAlso (e.dataOut = "32614")) Then    ' Snapshot Tool Active
            RaiseEvent SnapshotCreated()
         End If
      End If
   End If
If there is a left mouse button up message, on the 'pages' and the snapshot tool is active, then a snapshot has been created.

Then I call "DoEvents" to let the PDF viewer finish it's work, and then try to get the image from the clipboard.

But, at the moment this will always return me the previous snapshot, not the new snapshot.

Any ideas?

Is there a better way to approach this?

Thanks in advance

Wolfgang
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19876
Joined: Mon Jan 12, 2009 8:07 am

Re: Displaying and/or Saving Snapshot

Post by Stefan - PDF-XChange »

Hi Wolfgang,

I've asked a colleague from the dev team (Vasyl) to take a look, but he is in our Canadian office so the reply from him will come a bit later.

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

Re: Displaying and/or Saving Snapshot

Post by Vasyl - PDF-XChange »

Hi Wolfgang.
But, at the moment this will always return me the previous snapshot, not the new snapshot.
I can suggest next solution:

instead of direct call:
RaiseEvent SnapshotCreated()

use timer:
StartTimer(SnapshotCreatedTmId, 10) ; // 10ms or any other small interval

then handle timer-event:

OnSnapshotCreatedTm()
{
StopTimer(SnapshotCreatedTmId);
RaiseEvent SnapshotCreated();
}

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.
Wolfgang Weh
User
Posts: 7
Joined: Fri Feb 27, 2015 12:57 pm

Re: Displaying and/or Saving Snapshot

Post by Wolfgang Weh »

Hi Vasyl,

yes, that helps, it works :)

Thank you!

Have a nice weekend

Wolfgang
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19876
Joined: Mon Jan 12, 2009 8:07 am

Re: Displaying and/or Saving Snapshot

Post by Stefan - PDF-XChange »

:)