Using a WebBrowser control to view PDF and execute embedded javascript

Participant ,
Nov 16, 2017

Copy link to clipboard

Copied

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

Views

1.2K

Likes

Translate

Translate

Report

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

Using a WebBrowser control to view PDF and execute embedded javascript

Participant ,
Nov 16, 2017

Copy link to clipboard

Copied

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

Views

1.2K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 16, 2017 0
Most Valuable Participant ,
Nov 16, 2017

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 16, 2017 1
Adobe Community Professional ,
Nov 16, 2017

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 16, 2017 2