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 .
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 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.
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.
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.
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?
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.
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?
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.