Link to home
Start Free TrialLog in
Avatar of markmcwiggins
markmcwiggins

asked on

How to add Javascript 'print' (etc.) buttons to PDF web form?

I'm developing an application that's supposed to have 'print' and 'email' buttons on the PDF form. I see the JavaScript 'print'
reference (and postings here), but how do I include both in the web page? I can see the PDF (on supported browsers) if I access
it as a URL by itself, but I tried inserting it into a page with <IMG> and <EMBED> tags with no results.

I don't have control of the PDF content, so the button graphic will have to overlay the PDF or be very near it. Obviously this is
a Standard Thing to Do, but I can't find an example in my tech library nor via Googling.

Thanks in advance for any guidance whatsoever!
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

This is not a standard thing to do...

You have to add these buttons to the PDF file if you want to make use of Acrobat's form submission and printing capabilities. You cannot submit a form from outside of Acrobat (e.g. with a HTML button), you may be able to print the file, by using DDE to remote control Acrobat (I'm not saying that it will work however).

Is the PDF file you are dealing with a PDF form (e.g. does it have form fields)? Is the file protected agains changes? If not, you can add the buttons to the file.
Avatar of markmcwiggins
markmcwiggins

ASKER

So when I see these things they are customized PDFs or just frames?

I guess I will just do this with a small frame at the top or bottom. Thanks.
If you want to call these files "customized PDFs", then yes. They are PDF forms, and a form can contain a number of things: edit fields, list boxes, check boxes, and buttons. When you ceate a button in a PDF file, you can define what the form will do when the button is pressed (e.g. run a JavaScript, submit the form, reset the form, ...).
OK ... where's the best source of PDF documentation on doing this button programming?

The frame solution I mention above might work but is more problematical in supporting
multiple OSes, etc., etc.
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial