PDF图片操作

来源:互联网 发布:政府工作量化指标数据 编辑:程序博客网 时间:2024/06/05 01:57

1.概述
       图片可以是WMF、Gif、Jpeg和PNG。

使用4个URL得到:
       Image wmf = Image.getInstance(new URL("../examples/harbour.wmf"));
       Image gif = Image.getInstance(new URL("../examples/vonnegut.gif"));
       Image jpeg = Image.getInstance(new URL("../examples/myKids.jpg"));
       Image png = Image.getInstance(new URL("../examples/hitchcock.png"));

2.图片添加到单元格
       有两个副作用:
              表格的宽度是确定,当图片超出单元格的宽度时,将自动缩小。
              你不能进行文字绕排和为图片添加下划线。

3.图片链接注释
       如果你希望得到一个可点击的图片,或者想添加链接注释到图片上,你需要创建一个Annotation对象,并添加到图片上,你不需要指定位置(你可以使用0,0,0,0),该位置会内部更新以适合该图片。
       gif.Annotation = new Annotation(0, 0, 0, 0, "Chap1102b.pdf", 3);
       jpeg.Annotation = new Annotation("picture", "These are my children", 0, 0, 0, 0);

 

转载于:http://blog.chinaunix.net/uid-122937-id-3056520.html

0 0