Signatures and initials cmd not working...

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Signatures and initials cmd not working...

Post by lidds »

I am running the following code, but it does not seem to work:

Code: Select all

Dim cmd As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.Find("cmd.document.signatures.placesign")
Me.docPreview.Inst.ExecUICmd2(cmd.ID)
I have noticed on your actual menubar that you display the signature on the dropdown, then once selected it places it. How would I go about doing this if I am not using your menubar, but my own? e.g. get the signature image and a command to place the selected signature?

Thanks in advance

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Signatures and initials cmd not working...

Post by Sasha - Tracker Dev Team »

Hello Simon,

The command that you mentioned does not execute anything - it's just a submenu holder.
As for your case, the best way would be to use the op.document.addDigitalSignature direclty.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Signatures and initials cmd not working...

Post by lidds »

Alex,

The issue is that I want to allow the user to use a basic signature type authentication, however the op.document.addDigitalSignature command placed a digital signature, Not a initial or signature type.

Could you please explain the best way to achieve using the initial and signature functions.

Thanks in advance

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Signatures and initials cmd not working...

Post by Sasha - Tracker Dev Team »

Hello Simon,

Can you please provide a better description of what you mean by "initial or signature type"? Screenshot is always welcome.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Signatures and initials cmd not working...

Post by lidds »

Alex,

What I want to do is somehow achieve what you guys are doing in your menubar, as shown in the below screen shot. I am not to bothered about showing the image of the signature, but just want to be able to place a signature, not digital signature I can already do that.

So I guess what I need to be able to do is know the command to place a signature?
SignandInit.png
Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Signatures and initials cmd not working...

Post by Sasha - Tracker Dev Team »

Hello Simon,

I will try whether this is possible and will reply back.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Signatures and initials cmd not working...

Post by lidds »

Alex,

I was just wondering if there is any update on this?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Signatures and initials cmd not working...

Post by Sasha - Tracker Dev Team »

Hello Simon,

Just spoke with one of our lead devs - for this to work, the IPXV_Tool interface should be extended with another interface for the stamp tool and this is quite a problem because of multi-derivative structure of it. Basically this means that this won't be available any time soon.
If you want you can show this context menu from your custom button or something like that - that is possible.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Signatures and initials cmd not working...

Post by lidds »

Alex,

How would I go about showing this menu from my custom menu, do you have an example you can share.

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Signatures and initials cmd not working...

Post by Sasha - Tracker Dev Team »

Hello Simon,

Well, you will have to CreateCmdMenu and then fill it with needed items. After that call the ShowPopupMenu method.
The ID of the signature list is cmd.signs.list.
And here's the IDs of the other popup menu elements that are in the Signatures And Initials submenu:
cmd.signs.manage
cmd.signs.applyAll
cmd.signs.cancelAll

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Signatures and initials cmd not working...

Post by lidds »

Alex,

Thanks for your help.

I just wanted to check something to see if it is possible to achieve placing a signature and initial using the revised method.

If I was to manage the users signatures in my application so the sign.pdf in the PDF Tracker AppData folder only contained one signature and that signature was for the logged in user is it possible to place the signature now via code?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Signatures and initials cmd not working...

Post by Sasha - Tracker Dev Team »

Hello Simon,

As I explained previously - right now there is no possibility to set the stamp selection for the Stamp Tool. This is possible only via the submenu.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Re: Signatures and initials cmd not working...

Post by prime clinical systems »

Pretty easy really, I had same problem VB6, first, setup the sig/stamp you want to use with Tracker dialog, then this works.

Dim cmdBar As PDFXEditCtl.IUIX_CmdBar
Dim nFlatIndex As Long
Dim cmdDoc As PDFXEditCtl.IUIX_CmdItem
Set cmdBar = Me.PDF.Inst.ActiveMainFrm.View.MenuBar
nFlatIndex = cmdBar.FlatFindFirstItemByCmdName("cmd.document")
Set cmdDoc = cmdBar.FlatGetItem(nFlatIndex)
Dim cmdDocMenu As PDFXEditCtl.IUIX_CmdMenu
Set cmdDocMenu = cmdDoc.SubMenu
Dim nMenuIndex As Long
nMenuIndex = cmdDocMenu.FindFirstItemByCmdName("cmd.document.signatures.placesign")
Dim cmdSigSubMenu As PDFXEditCtl.IUIX_CmdMenu
If nMenuIndex = -1 Then
MsgBox "Sig stamp command was not found, call support."
Exit Sub
End If
Set cmdSigSubMenu = cmdDocMenu.Item(nMenuIndex)
Dim IUIXobj As PDFXEditCtl.IUIX_Obj
Set IUIXobj = Me.PDF.Inst.ActiveMainView.Obj
Dim pPos As PDFXEditCtl.tagRECT
pPos.left = 200
pPos.bottom = 200
Call Me.p_uiInst.CmdManager.ShowPopupMenu(IUIXobj, cmdSigSubMenu, pPos)
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Signatures and initials cmd not working...

Post by Sasha - Tracker Dev Team »

Hello Clifford,

What Simon meant that he wants to select the signature programmatically, meaning that he clicks on a button and that launches the Tool with the needed Signature selected - that is not possible right now.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Re: Signatures and initials cmd not working...

Post by prime clinical systems »

Well Alex, if that is what he wants, easy work around is to store the users signatures in the database, then extract the image for that user clicking own custom Place Signature like this:

Add a form field, can be a signature form field, then just do this, and remove the form field works fine:
nID = Me.PDF.Inst.Str2ID("op.document.addImage", False)
Set Op = Me.PDF.Inst.CreateOp(nID)
Set Input1 = Op.Params.Root("Input")
Input1.v = Me.PDF.Doc
Set Options = Op.Params.Root("Options")
Options("Page").v = Me.PDF.CurrentPage
Options("Pos.top").v = FField.Widget(0).RECT.top
Options("Pos.left").v = FField.Widget(0).RECT.left
Options("Pos.right").v = FField.Widget(0).RECT.right
Options("Pos.bottom").v = FField.Widget(0).RECT.bottom
Options("AlignMode").v = 1 + 4
Options("AsStamp").v = True
Dim DestPath As PDFXEditCtl.IAFS_Name
Set DestPath = Me.p_fsInst.DefaultFileSys.StringToName(SigPath)
Options("Src").v = DestPath
Set FFieldSel = FField
Op.Do
JS = "this.removeField(" & Chr(34) & FFieldSel.FullName & Chr(34) & ");"
Call Me.PDF.Inst.ExecuteJS(Me.PDF.Doc, JS, PAEC_Doc, PAESC_Exec, Nothing, Result)
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Signatures and initials cmd not working...

Post by Sasha - Tracker Dev Team »

Hello Clifford,

From what I see that's also not it - basically from what I see, he wants to achieve a cursor with the signature that appears when you click here:
Capture14.PNG
If he wanted to place the signature into the needed position - then the op.document.addDigitalSignature would be used for that.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Signatures and initials cmd not working...

Post by lidds »

Alex,

I am not to fused about changing the cursor to a signature cursor, all I really want the user to be able to do is define a region using the cursor and then to place the signature into that position. I do not mind even if it is a bit of a hack that the user my place a annot rectangle and this is used to calculate the location and then delete the rectangle after placement of the signature.

I think I have already tried the op.document.addDigitalSignature but this places a digital signature NOT initials type signature.

Also as I said earlier there will only ever be one person's signature in the PDF XChange appData signature PDF as I am overwriting this from a stored user signature PDF from a database.

Any workaround is appreciated

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Signatures and initials cmd not working...

Post by Sasha - Tracker Dev Team »

Hello Simon,

All you can do now is place this list in your custom menu so that the user can choose an initial to place.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply