|
@@ -1,8 +1,10 @@
|
|
|
using ComPDFKitViewer.AnnotEvent;
|
|
|
using ComPDFKitViewer.PdfViewer;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.IO;
|
|
|
using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
|
+using Compdfkit_Tools.Helper;
|
|
|
using static Compdfkit_Tools.PDFControlUI.CPDFAnnoationListUI;
|
|
|
|
|
|
namespace Compdfkit_Tools.PDFControl
|
|
@@ -111,5 +113,36 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
var bindAnnotationResult = e as BindAnnotationResult;
|
|
|
pdfViewer.SelectAnnotation(bindAnnotationResult.PageIndex, bindAnnotationResult.AnnotIndex);
|
|
|
}
|
|
|
+
|
|
|
+ private void ImportBtn_Click(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ var selectedPath = CommonHelper.GetExistedPathOrEmpty("XFDF Files (*.xfdf)|*.xfdf");
|
|
|
+ if (string.IsNullOrEmpty(selectedPath)) return;
|
|
|
+ var tempPath = Path.Combine(Path.GetDirectoryName(selectedPath), "temp");
|
|
|
+ if (!Directory.Exists(tempPath))
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(tempPath);
|
|
|
+ }
|
|
|
+ pdfViewer.Document.ImportAnnotationFromXFDFPath(selectedPath,tempPath);
|
|
|
+
|
|
|
+ LoadAnnotationList();
|
|
|
+ pdfViewer.UndoManager.CanSave = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void ExportBtn_Click(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ var selectedPath = CommonHelper.GetGeneratePathOrEmpty("XFDF Files (*.xfdf)|*.xfdf",pdfViewer.Document.FileName);
|
|
|
+ if (string.IsNullOrEmpty(selectedPath)) return;
|
|
|
+ var tempPath = Path.Combine(Path.GetDirectoryName(selectedPath), "temp");
|
|
|
+ if (!Directory.Exists(tempPath))
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(tempPath);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pdfViewer.Document.ExportAnnotationToXFDFPath(selectedPath, tempPath))
|
|
|
+ {
|
|
|
+ System.Diagnostics.Process.Start("explorer.exe", "/select," + selectedPath);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|