Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/387.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PDF表单作为Java UI_Java_Swing_Itext - Fatal编程技术网

使用PDF表单作为Java UI

使用PDF表单作为Java UI,java,swing,itext,Java,Swing,Itext,我已经看到,使用iText可以创建交互式PDF表单()。这很有趣,我想知道是否有可能从Java桌面应用程序内部填充PDF表单。 最后,我需要知道是否可以从Java应用程序中打开PDF文件。可能吗 谢谢 你可以考虑使用开源版和专业版。以下来自文档的示例显示了如何在JPanel中显示PDF: String filePath = "somefilepath/myfile.pdf"; // build a controller SwingController controller = new Swin


我已经看到,使用iText可以创建交互式PDF表单()。这很有趣,我想知道是否有可能从Java桌面应用程序内部填充PDF表单。 最后,我需要知道是否可以从Java应用程序中打开PDF文件。可能吗
谢谢

你可以考虑使用开源版和专业版。以下来自文档的示例显示了如何在JPanel中显示PDF:

String filePath = "somefilepath/myfile.pdf";

// build a controller
SwingController controller = new SwingController();

// Build a SwingViewFactory configured with the controller
SwingViewBuilder factory = new SwingViewBuilder(controller);

// Use the factory to build a JPanel that is pre-configured
//with a complete, active Viewer UI.
JPanel viewerComponentPanel = factory.buildViewerPanel();

// add copy keyboard command
ComponentKeyBinding.install(controller, viewerComponentPanel);

// add interactive mouse link annotation support via callback
controller.getDocumentViewController().setAnnotationCallback(
      new org.icepdf.ri.common.MyAnnotationCallback(
             controller.getDocumentViewController()));

// Create a JFrame to display the panel in
JFrame window = new JFrame("Using the Viewer Component");
window.getContentPane().add(viewerComponentPanel);
window.pack();
window.setVisible(true);

// Open a PDF document to view
controller.openDocument(filePath);

我不确定你在问什么,考虑修改吧。谢谢,我现在检查过了,太可怕了!正是我需要的!