Jelajahi Sumber

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

liyuxuan 3 bulan lalu
induk
melakukan
9961eaf2ce

+ 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;
                     }