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

Posted on 2005-04-24
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
    LVL 44

    Expert Comment

    by:Karl Heinz Kremer
    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.
    LVL 2

    Author Comment

    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
    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, ...).
    LVL 2

    Author Comment

    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

    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:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Title # Comments Views Activity
    Printing attachments from Yahoo mail 1 976
    HP 401m prints PDF files incorrectly 14 64
    merge adobe pdf files 14 76
    PDF File Shrinker 10 69
    The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
    PaperPort is a popular document imaging/management product from Nuance Communications ( It is in widespread use by both individuals ( and businesses (http:/…
    In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
    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 …

    759 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

    12 Experts available now in Live!

    Get 1:1 Help Now