How to programatically access adobe form's fields/methods/events in java?

Posted on 2006-03-29
Last Modified: 2010-05-18
1). I need programatically manipulate the Adobe form's fields/methods/events/values.
2). I don't have Adobe Form Server.
3). Is there any util class/tool (In a jar) I can use to manipulate the Adobe Form's fields/methods/events/values in java?

Please provide some sample.

Question by:hpeng
    LVL 30

    Accepted Solution

    Hopefully, iText should have it (not sure though):
    LVL 3

    Assisted Solution

    hi try this...
    import java.awt.*;
    import java.awt.event.*;

    import com.adobe.acrobat.Viewer;

    public class SampleReader extends Viewer

    public SampleReader() throws Exception {

    public static void main(String args[]) {
    Frame f = new Frame("Sample Acrobat Reader");

    Label top = new Label("Acrobat Reader created using adobe.Acrobat.Viewer", Label.CENTER);
    top.setBackground(Color.LIGHT_GRAY) ;
    f.add(top, BorderLayout.NORTH);
    f.add(new Label("Adobe Acrobat Reader - Alpha release - 1998", Label.CENTER), BorderLayout.SOUTH);
    try {

    final Viewer acrobat = new Viewer();

    f.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {

    if (acrobat != null) {



    try {

    FileInputStream in = new FileInputStream("d:\\PDF\\task5.pdf");

    } catch (FileNotFoundException x) {
    System.out.println("File not found!");


    f.add(acrobat, BorderLayout.CENTER);

    // you must call activate to enable the Viewer object
    // to layout its sub-components and the further initialization
    // needed for it to be displayed.

    acrobat.activate(); //WithoutBars();

    } catch (Exception x) {
    f.add(new Label("Unable to create an Acrobat Reader"), "Center");

    f.setSize(400, 400);;

    LVL 3

    Assisted Solution

    Also u can go to and search for adobe programs u can plenty of list in the forum
    it will help u.

    Author Comment

    Actually my scenario is:
    1). I have an adobe form which contains many fields, user can manually input value to each field.
    2). and an export button on the form which can export the content of current pdf to a XML. Seems the export button is calling a script like """,0)"
    3). and an import button which can import the content from an outside XML. And the import button just calls script like ""
    4). The adobe form is base on IPC 1752 standard.

    I am wondering:
    1). Whether I can execute the same script (like in java to import/export data?
    2). I can manually import/export data to this form by java?

    The purpose is to automatically import/export xml data to & from the PDF without need user click on the import/export button.



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    779 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

    18 Experts available now in Live!

    Get 1:1 Help Now