使用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);
我不确定你在问什么,考虑修改吧。谢谢,我现在检查过了,太可怕了!正是我需要的!