Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using a WebBrowser control to view PDF and execute embedded javascript

Participant ,
Nov 16, 2017 Nov 16, 2017

Hello,

How can I execute the embedded javascript inside a pdf?

I'm using the default WPF WebBrowser control to view a pdf. 

Here's the XAML:

<WebBrowser Name="_web"/>

In the .cs I do this to view the .pdf:

_web.Navigate("test.pdf");

Everything works great.  The test.pdf has a javascript method called "IsComplete".

How do I call the IsComplete method? 

I have Adobe Acrobat DC Pro installed.

TOPICS
Acrobat SDK and JavaScript
2.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 16, 2017 Nov 16, 2017

Have you seen anything to suggest you should be able to?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 16, 2017 Nov 16, 2017
LATEST

I'm assuming you want to run the script from JavaScript on the web page?

You can do this through Acrobat's host container interface.  I don't know how well supported it is anymore, but here is a link to a site I build many years ago to test it out.

BTW: the site doesn't work. It's supposed to trade data between two PDFs, I don't know whether its because of changes in security or supported functionality.

But you're welcome to it

Browser JavaScript

Here's the entry in the Acrobat JavaScript Reference

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines