PdfNet只读注释不是只读

时间:2016-08-05 13:03:27

标签: c# winforms annotations pdftron pdfnet

我正在使用PdfNet(C#)进行Winforms。

我希望能够为文本加下划线,所以我创建了一个下划线注释 像这样:

Annot underlineAnnot = Annot.Create(m_document, Annot.Type.e_Underline, rect)
underlineAnnot.SetFlag(Annot.Flag.e_read_only);

根据此页面,无法移动只读注释:https://www.pdftron.com/pdfnet/docs/PDFNet/html/T_pdftron_PDF_Annot_Flag.htm

但是当我使用工具模式e_annot_edit移动它时,它确实会移动......

如何“锁定”注释以使其不对鼠标事件做出反应?

1 个答案:

答案 0 :(得分:1)

目前,观众不会强制执行只读。

您可以自己轻松完成此任务。

使用以下签名创建委托方法。

print("QR Code Created: %s" % filename)  

然后在创建PDFViewCtrl对象时注册回调

return false to allow editing, otherwise return true
public bool edit_annot_proc(Annot annot, object obj)
{
    return annot.GetFlag(Annot.Flag.e_read_only);
}