栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Java PDF查看器

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Java PDF查看器

看看这些免费的pdf渲染器…

一些链接…

  1. http://www.icepdf.org/(现在位于http://www.icesoft.org/java/projects/ICEpdf/overview.jsf-Apache 2 Open Source)

  2. http://www.jpedal.org/support_siEclipse.php(现在位于https://www.idrsolutions.com/jpedal/-商业)

  3. https://java.net/projects/pdf-renderer(仍可用https://github.com/yarick123/pdf-renderer-LGPL-2.1)

更新

根据http://www.icepdf.org/,

ICEpdf是一个开源Java PDF引擎,可以在任何Java应用程序内或Web服务器上呈现,转换或提取PDF内容。

对于基本功能,您必须在类路径中包含

icepdf-core.jar
icepdf-viewer.jar
。根据要求,您还可以添加SVG支持。

取自iceface示例文件夹:

import org.icepdf.ri.common.SwingController;import org.icepdf.ri.common.SwingViewBuilder;import javax.swing.*;public class ViewerComponentExample {    public static void main(String[] args) {        // Get a file from the command line to open        String filePath = args[0];        // build a component controller        SwingController controller = new SwingController();        SwingViewBuilder factory = new SwingViewBuilder(controller);        JPanel viewerComponentPanel = factory.buildViewerPanel();        // add interactive mouse link annotation support via callback        controller.getdocumentViewController().setAnnotationCallback(     new org.icepdf.ri.common.MyAnnotationCallback(  controller.getdocumentViewController()));        Jframe applicationframe = new Jframe();        applicationframe.setDefaultCloseOperation(Jframe.EXIT_ON_CLOSE);        applicationframe.getContentPane().add(viewerComponentPanel);        // Now that the GUI is all in place, we can try openning a PDF        controller.opendocument(filePath);        // show the component        applicationframe.pack();        applicationframe.setVisible(true);    }}

上面的代码可帮助您在回转组件上显示PDF。您可以在SWT环境中进行相同的操作(看一下

SwingViewBuilder
..有点困难,但是SWT的外观和感觉会如此)或使用
org.eclipse.swt.awt.SWT_AWT
(有点简单…但是会有摇摆+
swt的外观)…但是两种方法都可以解决您的目的。还要检查许可证文件夹中的适用许可证。

希望这会有所帮助。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/452575.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号