|
@@ -96,6 +96,7 @@ namespace compdfkit
|
|
|
|
|
|
public void InitWithFilePath(string filePath)
|
|
|
{
|
|
|
+
|
|
|
pdfViewControl = new PDFViewControl();
|
|
|
pdfViewControl.PDFView.InitDocument(filePath);
|
|
|
}
|
|
@@ -133,7 +134,8 @@ namespace compdfkit
|
|
|
CPDFSaclingControl.InitWithPDFViewer(pdfViewControl.PDFView);
|
|
|
CPDFSaclingControl.SetZoomTextBoxText(string.Format("{0}", (int)(pdfViewControl.PDFView.ZoomFactor * 100)));
|
|
|
|
|
|
- pdfAnnotationControl.SetPDFViewer(pdfViewControl.PDFView);
|
|
|
+ InitialPDFViewControl(pdfViewControl);
|
|
|
+
|
|
|
FloatPageTool.InitWithPDFViewer(pdfViewControl.PDFView);
|
|
|
BotaSideTool.InitWithPDFViewer(pdfViewControl.PDFView);
|
|
|
BotaSideTool.SelectBotaTool(BOTATools.Thumbnail);
|
|
@@ -142,6 +144,20 @@ namespace compdfkit
|
|
|
PropertyContainer.Visibility = Visibility.Collapsed;
|
|
|
}
|
|
|
|
|
|
+ public void InitialPDFViewControl(PDFViewControl newPDFViewer)
|
|
|
+ {
|
|
|
+ pdfAnnotationControl.SetPDFViewer(newPDFViewer.PDFView);
|
|
|
+ pdfAnnotationControl.AnnotationCancel();
|
|
|
+ AnnotationBarControl.ClearAllToolState();
|
|
|
+ ExpandRightPropertyPanel(null, Visibility.Collapsed);
|
|
|
+ pdfAnnotationControl.ClearAnnotationBar += PdfAnnotationControl_ClearAnnotationBar;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void PdfAnnotationControl_ClearAnnotationBar(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ AnnotationBarControl.ClearAllToolState();
|
|
|
+ }
|
|
|
+
|
|
|
#region Load Document
|
|
|
/// <summary>
|
|
|
/// InfoChanged
|
|
@@ -976,10 +992,13 @@ namespace compdfkit
|
|
|
// Clear the ToolBar
|
|
|
// Collapse the ToolBar
|
|
|
// Clear And Collapse the property panel.
|
|
|
+ // Change the mousemode
|
|
|
case "Annotation":
|
|
|
AnnotationBarControl.Visibility = Visibility.Collapsed;
|
|
|
AnnotationBarControl.ClearAllToolState();
|
|
|
+ pdfAnnotationControl.ClearPanel();
|
|
|
ExpandRightPropertyPanel(null, Visibility.Collapsed);
|
|
|
+ pdfViewControl.PDFView?.SetMouseMode(MouseModes.PanTool);
|
|
|
|
|
|
break;
|
|
|
|
|
@@ -1090,7 +1109,7 @@ namespace compdfkit
|
|
|
if (e != CPDFAnnotationType.Audio && e != CPDFAnnotationType.Image)
|
|
|
{
|
|
|
ExpandRightPropertyPanel(pdfAnnotationControl, Visibility.Visible);
|
|
|
- AnnotationBarBtn.IsChecked = true;
|
|
|
+ RightPanelButton.IsChecked = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1167,7 +1186,7 @@ namespace compdfkit
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private void UndoBtn_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
if (pdfViewControl != null && pdfViewControl.PDFView != null)
|
|
@@ -1187,6 +1206,7 @@ namespace compdfkit
|
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
pdfAnnotationControl = new CPDFAnnotationControl();
|
|
|
+ BotaSideTool.AddBOTAContent(BOTATools.Thumbnail | BOTATools.Outline | BOTATools.Bookmark | BOTATools.Search | BOTATools.Annotation);
|
|
|
LoadDocument();
|
|
|
}
|
|
|
|