Browse Source

链接测试

OYXH\oyxh 1 year ago
parent
commit
9727cdd4c0

+ 13 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -39,6 +39,7 @@ using PDF_Master.EventAggregators;
 using DryIoc;
 using static Dropbox.Api.TeamLog.PaperDownloadFormat;
 using ComPDFKit.Import;
+using ComPDFKit.PDFAnnotation;
 
 namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 {
@@ -974,19 +975,24 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             {
                 if (historyPageIndex != -1)
                 {
-                    SelectAnnotation();
                     pdfViewer.GoToPage(historyPageIndex);
+                    SelectAnnotation();
 
                     BackToPage(historyPageIndex, pageIndex);
 
                     ChangeBtnGOorBack("GO", btnGOorBack);
-                    pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
+                    //pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
                 }
             }
         }
 
         private void BackToPage(int historyPageIndex, int pageIndex)
         {
+            CPDFLinkAnnotation cPDFLink = LinkAnnotArgs.GetLinkAnnot();
+            if (cPDFLink == null)
+            {
+                return;
+            }
             //注释位置
             Rect rect = LinkAnnotArgs.GetLinkPaintArea();
             //定位
@@ -1017,6 +1023,11 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
         private void GoToPage(int pageIndex)
         {
+            CPDFLinkAnnotation cPDFLink = LinkAnnotArgs.GetLinkAnnot();
+            if (cPDFLink == null)
+            {
+                return;
+            }
             //定位
             paintrect = LinkAnnotArgs.GetLinkCreateArea();
             double height = 0;