Semi-automatically placing a stamp

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

Post Reply
Chrisme
User
Posts: 12
Joined: Wed Jul 25, 2012 6:28 pm

Semi-automatically placing a stamp

Post by Chrisme »

Hi,
I am new to the viewer activex sdk. So far i managed to display a pdf document in my application. That was pretty easy :D.
Now i try to achieve this:
When the user clicks on one of the command buttons in my application, i want to place a certain predefined stamp on the document. I already succeeded in adding a stamp using javascript code (like in the examples in the Adobe javascript reference). But I also want the user to select the document position for the stamp by clicking at it.
In other words: When the user clicks my command button, my program wants to
  • 1) prepare the image and text of the stamp,
    2) call whatever is necessary to change the mousepointer to a stamp symbol and let the user place the stamp on the document,
    3) receive a notification when the stamp was placed by the user.
Can this be done and can you give me a clue on how to do it in VB?

Thank you,
Christian
Nico - Tracker Supp
User
Posts: 205
Joined: Fri May 18, 2012 8:41 pm

Re: Semi-automatically placing a stamp

Post by Nico - Tracker Supp »

Hi Christian,

Thank you for your post.
You can take a look at our View.exe example for Visual Basic .NET or Visual Basic 6.0 which enables the tool bar with the stamp tool from XChange Viewer to apply a stamp into a document. Part of the things you want to manage are already managed by the Active X control and fortunately you don't have to worry about, i.e.: mouse icon changes, selected stamp is prepared and user just needs to locate stamp on the document. The example provided is a good start to familiarized with the XChange Viewer controls.
Thanks.

Sincerely,
Nicolas
Chrisme
User
Posts: 12
Joined: Wed Jul 25, 2012 6:28 pm

Re: Semi-automatically placing a stamp

Post by Chrisme »

Hi Nicolas,

Thank you for your reply.
I studied your examples, but I did not find anything which looks suitable for want I want to achieve.

View.exe only demonstrates the usage of your toolbars and panes. I don't want the user to select the stamp tool on your toolbar. Instead my application should select the stamp tool and start the process. I understand, I can call something like CoPDFXCview1.DoVerb("", "ExecuteCommand", vDataIn, vDataOut, 0) (with vDataIn set to 33131) to start the stamp tool. But I have two problems with this:

1) How can my application programmatically select which stamp to use and which subject the stamp sould have?
2) My program needs a notification when the stamp was placed by the user.

Though my program can receive events from the ActiveX Control (in VB the Subprocedure CoPDFXCview1_OnEvent(Type As Long, Name As String, DataIn As Variant, DataOut As Variant, Flags As Long) is called), I get no event notification when the stamp was placed.

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

Re: Semi-automatically placing a stamp

Post by Tracker Supp-Stefan »

Hello Chrisme,

You can see how to select a particular stamp here:
https://forum.pdf-xchange.com/ ... =36&t=7240
SetProperty("Commenting.Stamp.Styles[0].Type", "<Stamp Name>", 0);
<Stamp Name> represents internal, unique name of stamp object (for new stamps, which are added by the viewer, it should be GUID).
You can see the stamp's internal name in the drop-down menu for the 'Stamp Tool' in tooltips with the 'Ctrl' key pressed.
And you can e.g. listen to mouse button down events - and when such occurs check which is the current active tool, and if it's the stamp tool implement your own code for handling that.

Best,
Stefan
Chrisme
User
Posts: 12
Joined: Wed Jul 25, 2012 6:28 pm

Re: Semi-automatically placing a stamp

Post by Chrisme »

Hi Stefan,
Thank you for your quick response. I'll try that. :D
Regards,
Christian
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6897
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Semi-automatically placing a stamp

Post by Paul - Tracker Supp »

:)
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Chrisme
User
Posts: 12
Joined: Wed Jul 25, 2012 6:28 pm

Re: Semi-automatically placing a stamp

Post by Chrisme »

I followed your recommendations. I am now able to start the stamp tool programatically and i do get a notification when the user has placed the stamp :) .

But it is too bad, that it is not possible to query the list of available stamps or to create a new stamp programatically :( .

Question 1: Since the stamps of your standard stamp palette are of no use for my application, would it be possible for me to prepare an own stamp palette which i could deliver with my application?

Question 2: I have read that you will come up with the new SDK version 3. Will this version provide the required functions? When will this version be available? I haven't licensed the current SDK version 2 yet. When i buy it now, will have to pay for version 3 again?

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

Re: Semi-automatically placing a stamp

Post by Tracker Supp-Stefan »

Hello Christian,

The default stamps are required by the PDF specification, but you can otherwise create any other stamp palettes you want - and distribute them with your application.

Purchasing a license now will entitle you to a free upgrade to v3 of the Viewer SDK - as each license we sell comes with a minimum of one year of free upgrades and maintenance (extra maintenance is also available) and with the end user Viewer planned for release this Autumn - the SDK will follow shortly.

Best,
Stefan
Chrisme
User
Posts: 12
Joined: Wed Jul 25, 2012 6:28 pm

Re: Semi-automatically placing a stamp

Post by Chrisme »

How do i distribute my own stamp palette? How are stamps and stamps palettes stored?
Can i just create one, and use SaveSettings/LoadSettings ? I tried this, but the new stamp palette is not included in the settings file.

Another question is, will the GUID of my own stamps be the same on my development system and on the systems of the end users?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17910
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Semi-automatically placing a stamp

Post by Tracker Supp-Stefan »

Hi Christine,

The stamps are stored in:
C:\Users\<<USER NAME>>\AppData\Roaming\Tracker Software\PDF-XChange Viewer\2.0\Stamps
So you will need copy the file with your custom stamps from that location, include it in your installer and then distribute it to all users and save it at the same location for each user. And yes - the stamps should be with the same GUID on the user machines as on your test one.

Best,
Stefan
Post Reply