OnEvent - handler doesn't work

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

mgasser
User
Posts: 4
Joined: Wed Jul 08, 2009 8:01 am

OnEvent - handler doesn't work

Post by mgasser »

I want to set a digital signature in my pdf with PDV Viewer SDK but i want catch th event "Prompts.ConfirmDocumentIncSave" to set the filename itself and ommit the confirmation to the user. But i never get PDFXCviewAxLib.PXCVA_EventTypes.PXCVA_OnDisplayPrompt, the control itself handels the "SaveAs" an no event is fired.

Whta i'am doing wrong ?

Thanks for help

My Event - Handler on Control looks like

Code: Select all

Private Sub AxCoPDFXCviewAkt_OnEvent(ByVal sender As System.Object, ByVal e As AxPDFXCviewAxLib._IPDFXCviewEvents_OnEventEvent) Handles AxCoPDFXCviewAkt.OnEvent
        If e.type = PDFXCviewAxLib.PXCVA_EventTypes.PXCVA_OnDisplayPrompt Then
            If e.name = "Prompts.ConfirmDocumentIncSave" Then
                Dim nDocID As Integer
                Dim filenameNew As String = System.IO.Path.GetTempPath() & System.IO.Path.GetFileNameWithoutExtension(System.IO.Path.GetTempFileName) & ".PDF"
                AxCoPDFXCviewAkt.GetActiveDocument(nDocID)
                AxCoPDFXCviewAkt.SetProperty("Documents[#" & CStr(nDocID) & "].Prompts.ConfirmDocumentIncSave.FileName", filenameNew)
                AxCoPDFXCviewAkt.SetProperty("Documents[#" & CStr(nDocID) & "].Prompts.ConfirmDocumentIncSave.UserChoice", 0)
                AddLogAction(LogAction.AddDoc, cmbGesellschaft.SelectedValue, gAktObj.Properties("F_DOCNUMBER").Value)
                SaveAsNewDokument(gAktObj, filenameNew, False, gDocclassnameAkt)
                MsgBox("Dokument ist signiert!", MsgBoxStyle.Information)
            End If
        End If

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

Re: OnEvent - handler doesn't work

Post by Vasyl - PDF-XChange »

Hi, mgasser.

You may resolve your problem by changing of one global property:

Code: Select all

ax.SetProperty("Documents.SaveMethod", "Full", 0);
By default the "Documents.SaveMethod" means the "FullOrIncrementalForDigSign" - it enforces control to incremental save of all dig-signed documents automatically, without any confirmation, see our SDK Help.

Thanks.
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.
mgasser
User
Posts: 4
Joined: Wed Jul 08, 2009 8:01 am

Re: OnEvent - handler doesn't work

Post by mgasser »

Hi Vasyl

Thanks for your reply.

Unfortunatley it doesn't help. I always get the "Save As" - Dialog on control after i attach a digital signing, but no event PDFXCviewAxLib.PXCVA_EventTypes.PXCVA_OnDisplayPrompt. I'd like to handle the SaveAs be my own by setting a known filename to replace the existing document in our documentarchivingsystem.

Kind regards

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

Re: OnEvent - handler doesn't work

Post by Vasyl - PDF-XChange »

Hi, Markus.

We cannot reproduce this issue.
One thought - you should call the ax.SetProperty("Documents.SaveMethod", "Full", 0) BEFORE any document opening.
Can you provide a simple example project for reproducing?

Thanks.
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.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: OnEvent - handler doesn't work

Post by Vasyl - PDF-XChange »

Hi, Markus.

If I understand you correctly - you wanted to override our "Save As" dialog after digital signing of document? If yes - it's impossible in current implementation, but we will add the special named notification like as "Notifications.SaveDocument". You will be able to replace the destination file name in our "Save As" dialog or replace/skip this dialog fully. Wait for the next build...

Best
Regards.
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.
mgasser
User
Posts: 4
Joined: Wed Jul 08, 2009 8:01 am

Re: OnEvent - handler doesn't work

Post by mgasser »

Hello Vasyl

thank you for your support. Your right, that is what i like to do.

Do you have an idea when your next build will be available ?

Kind regards

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

Re: OnEvent - handler doesn't work

Post by Stefan - PDF-XChange »

This is planned for some point in August so I would say at least a couple of weeks more Markus.

Best,
Stefan
patient chart manager, llc
User
Posts: 29
Joined: Thu Jan 03, 2013 7:43 pm

Re: OnEvent - handler doesn't work

Post by patient chart manager, llc »

This still does not work, and this event "Notifications.SaveDocument" does not fire.

I just wish there was a way for this to work, do not understand why the feature can't work like the one Prompts.ConfirmDocumentSave, which does work perfectly fine.

Please fix for 2.5.0.8 as this control is very stable, and to have to upgrade to V3 just for this one feature is hard to swallow.

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

Re: OnEvent - handler doesn't work

Post by Vasyl - PDF-XChange »

Please try the way described here:
https://forum.pdf-xchange.com/ ... 36&t=16489

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.