Browse Source

其他-大纲跳转

zhuyi 1 year ago
parent
commit
40094d1b89

+ 11 - 1
Demo/Examples/Compdfkit_Tools/PDFView/PDFOutline/PDFOutlineControl/CPDFOutlineControl.xaml.cs

@@ -1,6 +1,7 @@
 using ComPDFKit.PDFDocument;
 using ComPDFKit.PDFDocument.Action;
 using ComPDFKit.Tool;
+using ComPDFKit.Viewer.Helper;
 using Compdfkit_Tools.PDFControlUI;
 using ComPDFKitViewer;
 using System;
@@ -49,9 +50,18 @@ namespace Compdfkit_Tools.PDFControl
                     CPDFViewer pdfViewer = ViewControl.PDFViewTool.GetCPDFViewer();
                     CPDFDocument pdfDoc = pdfViewer.GetDocument();
                     CPDFDestination dest = outline.GetDestination(pdfDoc);
+                    Size size = DataConversionForWPF.CSizeConversionForSize( pdfDoc.GetPageSize(Convert.ToInt32(dest.PageIndex) - 1));
+                    if (dest.Position_X == -1)
+                    {
+                        dest.Position_X = 0;
+                    }
+                    if (dest.Position_Y == -1)
+                    {
+                        dest.Position_Y = (float)size.Height;
+                    }
                     if (dest != null)
                     {
-                        pdfViewer.GoToPage(dest.PageIndex, new Point(dest.Position_X, dest.Position_Y));
+                        pdfViewer.GoToPage(dest.PageIndex, new Point(dest.Position_X, size.Height - dest.Position_Y));
                     }
                 }
             }

+ 2 - 1
Demo/Examples/Compdfkit_Tools/PDFView/PDFThumbnail/PDFThumbnailControl/CPdfThumbnailControl.xaml.cs

@@ -94,7 +94,8 @@ namespace Compdfkit_Tools.PDFControl
             if (document==null || document.IsLocked)
             {
                 return;
-            }
+            };
+            pdfViewer.ReInitCacheDoc();
             cachePageList.Clear();
             OnThumbnailGenerated -= ThumbnailGenerated;
             OnThumbnailGenerated += ThumbnailGenerated;