VintaSoft PDF .NET Plug-in Discussions

Questions, comments and suggestions concerning VintaSoft PDF .NET Plug-in.

Board index < VintaSoft Imaging < VintaSoft PDF .NET Plug-in Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Javascript alert



Javascript alert

Post by HelloThere »

Hi !

We have a lot of PDF file that using the Alert Javascript function to notify users about validations (Ex : Wrong date format).

Is there a way to catch somewhere if Alert, Beep or call refering to app variable is been throwed ?

Thanks !

JP


Re: Javascript alert

Post by Alex »

Hello,
We have a lot of PDF file that using the Alert Javascript function to notify users about validations (Ex : Wrong date format).
Is there a way to catch somewhere if Alert, Beep or call refering to app variable is been throwed ?
Yes, you can catch when the alert function is called in JavaScript code of PDF document. For doing this you need override the "alert" method in WinFormsPdfJsApp class:
https://www.vintasoft.com/docs/vsimagin ... alert.html

For evaluating the functionality in our PDF Editor Demo you need do the following steps:
  • Open PDF Editor Demo in Visual Studio
  • Open file "PdfDemosCommonCode\DemosCommonCode.Pdf\JavaScript\PdfViewerJsApp.cs" in project PdfDemosCommonCode
  • Override the alert method in PdfViewerJsApp class:
    public override int alert(string cMsg, int nIcon, int nType, string cTitle, PdfJsDoc oDoc)
    {
        ...
    }
    
  • Run PDF Editor Demo
  • Open PDF document, which calls the alert function in JavaScript code
Best regards, Alexander


Page 1 from 1: 1