Solved

Can JavaScript be used in a PDF?

Posted on 2016-08-31
5
81 Views
Last Modified: 2016-08-31
I same advanced functionality I need, like a pop-up image on a hover...

Does PDF support this?

Embedded JavaScript?

Thanks
0
Comment
Question by:newbieweb
  • 3
  • 2
5 Comments
 
LVL 52

Assisted Solution

by:Julian Hansen
Julian Hansen earned 500 total points
ID: 41778016
PDF supports the embedding of any data - it is how it is interpreted that is important - and that comes down to the reader.

Adobe Acrobat does support JavaScript in documents you can read more about it here
http://www.adobe.com/devnet/acrobat/javascript.html
0
 

Author Comment

by:newbieweb
ID: 41778021
Oh, so I become dependent on the reader, which makes perfect sense.

Your point makes me now consider doing this as a website since I want consistency.

For example...
http://static.flipbuilder.com/demo/flippage-wedding-brochure/flippage-wedding-magazine.html#p=4

UNLESS there is a way to have this work for all PDF's, since I prefer the portable document model.
0
 
LVL 52

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 41778059
You can't really dictate what reader's a user is going to use or if they are going to disable script or not.

Other readers also support JS (https://www.foxitsoftware.com/blog/how-to-add-javascript-functionality-to-pdf-forms-without-coding/) for example.

If you are wanting to use the JavaScript to achieve the flip effect you might find that the functionality is not quite there to do that. I have dabbled a bit in the JS for PDF and came up against restrictions in what I could do and could not. Whether or not it can be used to achieve the effect your are referring to - I don't know - but I doubt it - if you could then we would have seen this instead of solutions that involve Flash (as in flipbuilder).
0
 

Author Closing Comment

by:newbieweb
ID: 41778101
You convinced me to do it as a web page. Thanks.
0
 
LVL 52

Expert Comment

by:Julian Hansen
ID: 41778175
You are welcome.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now