소스 검색

ComPDFKit.Tool(win) - 按文字选择效果创建链接注释

liyuxuan 3 달 전
부모
커밋
9961eaf2ce
2개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      Demo/Examples/ComPDFKit.Tool/CPDFToolManager.cs
  2. 11 0
      Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.Annot.cs

+ 2 - 0
Demo/Examples/ComPDFKit.Tool/CPDFToolManager.cs

@@ -1277,6 +1277,7 @@ namespace ComPDFKit.Tool
                 {
                     switch (createAnnotType)
                     {
+                        case C_ANNOTATION_TYPE.C_ANNOTATION_LINK:
                         case C_ANNOTATION_TYPE.C_ANNOTATION_HIGHLIGHT:
                         case C_ANNOTATION_TYPE.C_ANNOTATION_UNDERLINE:
                         case C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY:
@@ -2076,6 +2077,7 @@ namespace ComPDFKit.Tool
                                                     viewerTool.EndDrawAnnot();
                                                 }
                                                 break;
+                                            case C_ANNOTATION_TYPE.C_ANNOTATION_LINK:
                                             case C_ANNOTATION_TYPE.C_ANNOTATION_REDACT:
                                                 if (viewerTool.IsText())
                                                 {

+ 11 - 0
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.Annot.cs

@@ -510,6 +510,17 @@ namespace ComPDFKit.Tool
                                 historyGroup.Histories.Add(redactHistory);
                             }
                             break;
+                        case C_ANNOTATION_TYPE.C_ANNOTATION_LINK:
+                            {
+                                LinkAnnotHistory linkHistory= new LinkAnnotHistory();
+                                AnnotParam annotParam = ParamConverter.AnnotConverter(cPDFDocument, annotCore);
+                                linkHistory.Action = HistoryAction.Add;
+                                linkHistory.CurrentParam = (LinkParam)annotParam;
+                                linkHistory.PDFDoc = cPDFDocument;
+                                linkHistory.Action = HistoryAction.Add;
+                                historyGroup.Histories.Add(linkHistory);
+                            }
+                            break;
                         default:
                             break;
                     }