Gnostice PDFOne .NET怎么对PDF文件进行墨痕注释

作者:控件中国网   出处:控件中国网   2015-10-29 14:48:05   阅读:7

所谓墨痕注释即是客户在浏览PDF文件时随手涂鸦,就像看书时使用笔在书本上勾画重点一样,而在PDF阅读软件上要实现该功能怎么实现呢?Gnostice PDFOne .NET是一款PDF文档处理控件,可以帮助开发人员快速实现该功能,可以在阅读PDF文档时使用鼠标在PDF文档上进行墨痕注释,具体怎么实现可以参考下面的代码:
2015-07-SCREENSHOT-PDFOne-dotNET-Ink-Annotation.png
// Open a PDF document
PDFDocument doc = new PDFDocument(PDFOne_License.KEY);
doc.Load("USPTO_Catalog.pdf");
 
doc.MeasurementUnit = PDFMeasurementUnit.Inches;
 
// Create the ink annoation
PDFInkAnnot ink = new PDFInkAnnot();
ink.Title = "Ink annotation demo";
ink.Subject = "Annotation Demo";
ink.Content = "This is an ink annotation.";
ink.Vertices = 
new PointF[] {  
new PointF(6.7f,2.4f),
new PointF(4.2f,2.6f),
new PointF(4.15f,3f),
new PointF(5.2f,3.4f),
new PointF(5.7f,3.3f),
new PointF(6.5f,3.1f),
new PointF(6.5f,2.1f)
};
ink.LineColor = Color.Red;
ink.LineStyle = PDFAnnotLineStyle.Solid;
 
// Add the ink annotation to page 1
doc.CurrentPageNo = 1;
doc.AddAnnot(ink);
doc.Save("ink_annotation_demo.pdf");
doc.Close();
Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat