AsposePdf .Net make XMLHTTPRequest in background

Hi, Is it possible to add some code is PDF to build some kind of tracking system, every time PDF opens a particular url will get hit.

I was trying JavaScript Action but only alerts are working not the Ajax request.

 Document doc = new Document("D:\\1.pdf");
//Below line not working
            doc.Pages[1].Actions.OnOpen = new JavascriptAction("var xhttp = new XMLHttpRequest(); xhttp.open('GET', 'http://example.com/track?id=4', true); xhttp.send();");
//Close one is working
            doc.Pages[1].Actions.OnClose = new JavascriptAction("app.alert('close')");
            doc.Save("D:\\11.pdf");

Thanks,
Pawan

@pawanbold

Thank you for contacting support.

Would you please share expected output PDF document generated with Adobe Acrobat as Aspose.PDF API mimics its behavior. We will then investigate further to help you out.