国产成人AV无码一二三区,少女1到100集,国产精品久久久久精品综合紧,巜公妇之诱感肉欲HD在线播放

文章 > java基础 > Java如何在PDF添加注释

Java如何在PDF添加注释

java PDF

头像

小妮浅浅

2021-07-13 09:48:373416浏览 · 0收藏 · 0评论

流程

1、使用Document类加载PDF文档。

2、创建TextAnnotation对象,添加文本注释。

3、设定标题、主题等注释属性。

4、使用Border类设置注释的Border。

使用Document.getPages().get_Item(int).getAnnotations().add(Annotation)方法向文档添加注释。

5、用Document.save保存更新的PDF。

实例

// Open the source PDF document
Document pdfDocument = new Document("input.pdf");
 
// Create annotation
TextAnnotation textAnnotation = new TextAnnotation(pdfDocument.getPages().get_Item(1), new com.aspose.pdf.Rectangle(200, 400, 400, 600));
 
// Set annotation title
textAnnotation.setTitle("Sample Annotation Title");
 
// Set annotation subject
textAnnotation.setSubject("Sample Subject");
textAnnotation.setState(AnnotationState.Accepted);
 
// Specify the annotation contents
textAnnotation.setContents("Sample contents for the annotation");
textAnnotation.setOpen(true);
textAnnotation.setIcon(TextIcon.Key);
Border border = new Border(textAnnotation);
border.setWidth(5);
border.setDash(new Dash(1, 1));
textAnnotation.setBorder(border);
textAnnotation.setRect(new com.aspose.pdf.Rectangle(200, 400, 400, 600));
 
// Add annotation in the annotations collection of the page
pdfDocument.getPages().get_Item(1).getAnnotations().add(textAnnotation);
 
// Save the output file
pdfDocument.save("output.pdf");

以上就是Java在PDF添加注释的方法,希望对大家有所帮助。更多Java学习指路:Java基础

本教程操作环境:windows7系统、java10版,DELL G3电脑。

关注

关注公众号,随时随地在线学习

本教程部分素材来源于网络,版权问题联系站长!

金装律师第二季| 国产X9X9X9X9X9X任意...| 美女两个球球抖动抓球球视频 | 日产MV和欧美MV的外观对比| 40岁女人如饥似渴最佳解决方法| 庄达菲| 进击的巨人第一季| BOSS凶猛老公喂不饱十月初| 广汇能源股吧| 淫语....粗话....脏话小说| 林柔柔在厨房被C高潮| 蜜桃成熟| 日本在线观看| 自行车小游戏| 星空传媒天美传媒有限公司| 《巨大荫蒂》免费| 可以进入任何网站的浏览器| 江忍| 法国色情巜做爰狂欲| 办公室刺激战场3| 老婆同意了别人轮流联系我| 台球室的特殊待遇2HD| 法国电影《女流氓》的剧情简介| 美女和帅哥一起努力生产豆浆的视..| 妈妈用嘴巴帮我消火怎么办 | 《魅魔之耻》1~4集免费看| 《搬家工人的绝遇》观看| 爸爸的擎天柱让我看第二集 | 亲爱的妈妈3在线观看| 《胯下之臣》金银花露原文 | 20厘米能插到肚子吗| 老公刚日完又让朋友日| 擦边| 游泳教练在水里含我奶| 混合交换5HD| 男生把小因因放到女生困里视频| 《厨房激战5》完整版在线观看| 女性扒开大腿内侧小肚子痒 | 万人骑的大学生活笔趣阁| 恋爱之瘾完整版在线全集免费观看| 三叶草M码和欧洲码区别