We help IT Professionals succeed at work.

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

hpeng
hpeng asked
on
Medium Priority
811 Views
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.

Thanks
Comment
Watch Question

Principal Technologist
CERTIFIED EXPERT
Commented:
Hopefully, iText should have it (not sure though):

http://www.lowagie.com/iText/ 

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
hi try this...
import java.awt.*;
import java.awt.event.*;
import java.io.*;

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) {


acrobat.deactivate();
}

System.exit(0);
}
});

try {


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

} 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);
f.show();


}
}
also
http://www.activepdf.com/
http://big.faceless.org/products/report/index.jsp
http://big.faceless.org/products/pdf/index.jsp
Also u can go to www.javasoft.com and search for adobe programs u can plenty of list in the forum
it will help u.

Author

Commented:
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 "xfa.host.exportData("",0)"
3). and an import button which can import the content from an outside XML. And the import button just calls script like "xfa.host.importData()"
4). The adobe form is base on IPC 1752 standard. http://www.ipc.org/IPC-175x

I am wondering:
1). Whether I can execute the same script (like xfa.host.importData()) in java to import/export data?
or
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.

Thanks

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.