• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 784
  • Last Modified:

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

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
0
hpeng
Asked:
hpeng
  • 2
3 Solutions
 
Mayank SAssociate Director - Product EngineeringCommented:
Hopefully, iText should have it (not sure though):

http://www.lowagie.com/iText/ 
0
 
vikraman_bCommented:
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();


}
}
0
 
vikraman_bCommented:
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.
0
 
hpengAuthor 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

0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now