[Webinar] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2005-04-24
Medium Priority
Last Modified: 2012-05-05
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!
Question by:markmcwiggins
  • 3
  • 2
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 13857472
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.

Author Comment

ID: 13859997
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.
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 13860253
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, ...).

Author Comment

ID: 13860289
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.
LVL 44

Accepted Solution

Karl Heinz Kremer earned 1500 total points
ID: 13860351
The Acrobat 6 or 7 Professional Help document does contain information about how to create form submission buttons. For printing, you also need the "Acrobat JavaScript Scripting Reference" document, which you can download from Adobe's web site: http://partners.adobe.com/public/developer/pdf/topic_js.html

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Getting information about Fonts being used in a PDF file A colleague of mine recently faced an issue related to the PDF file format. The PDFs were containing mission critical client information, they were successfully mailed but there was a sm…
This article is in response to a question here (http://www.experts-exchange.com/Other/URLs/Q_28283850.html) at Experts Exchange. The Original Poster has a scanned signature and wants to make the background transparent so that the signature may be pl…
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
Suggested Courses

868 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