|
@@ -945,6 +945,84 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
|
|
|
#region 菜单
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 空白处-右键菜单-添加注释
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="sender"></param>
|
|
|
+ private void AddAnnotation_Click(object sender)
|
|
|
+ {
|
|
|
+ if (sender is MenuItem menuItem)
|
|
|
+ {
|
|
|
+ AnnotHandlerEventArgs annotHandler = null;
|
|
|
+ string str = menuItem.Tag.ToString();
|
|
|
+ viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
+ propertyPanel.IsAddLink = false;
|
|
|
+ propertyPanel.IsLocationLink = false;
|
|
|
+ if (str == AddAnnotType.AnnotFreehand.ToString())
|
|
|
+ {
|
|
|
+ annotHandler = GetFreehand();
|
|
|
+ }
|
|
|
+ if (str == AddAnnotType.AnnotFreeText.ToString())
|
|
|
+ {
|
|
|
+ annotHandler = GetFreetext();
|
|
|
+ }
|
|
|
+ if (str == AddAnnotType.AnnotSticky.ToString())
|
|
|
+ {
|
|
|
+ annotHandler = GetStickyNote();
|
|
|
+ }
|
|
|
+ if (str == AddAnnotType.AnnotSquare.ToString())
|
|
|
+ {
|
|
|
+ annotHandler = GetRect();
|
|
|
+ }
|
|
|
+ if (str == AddAnnotType.AnnotCircle.ToString())
|
|
|
+ {
|
|
|
+ annotHandler = GetCircle();
|
|
|
+ }
|
|
|
+ if (str == AddAnnotType.AnnotArrow.ToString())
|
|
|
+ {
|
|
|
+ annotHandler = GetArrowLine("Arrow");
|
|
|
+ }
|
|
|
+ if (str == AddAnnotType.AnnotLine.ToString())
|
|
|
+ {
|
|
|
+ annotHandler = GetArrowLine("Line");
|
|
|
+ }
|
|
|
+ if (str == AddAnnotType.AnnotLink.ToString())
|
|
|
+ {
|
|
|
+ propertyPanel.IsAddLink = true;
|
|
|
+ annotHandler = GetLink();
|
|
|
+ }
|
|
|
+ if (str == AddAnnotType.AnnotStamp.ToString())
|
|
|
+ {
|
|
|
+ annotHandler = GetStamp();
|
|
|
+ }
|
|
|
+ if (str == AddAnnotType.AnnotAutograph.ToString())
|
|
|
+ {
|
|
|
+ annotHandler = GetSignature();
|
|
|
+ }
|
|
|
+ if (annotHandler != null)
|
|
|
+ {
|
|
|
+ annotHandler.Author = Settings.Default.AppProperties.Description.Author;
|
|
|
+ PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
|
|
|
+ PDFViewer.SetToolParam(annotHandler);
|
|
|
+ ShowPropertyPanel(true);
|
|
|
+
|
|
|
+ #region 设计重新调整,阅读页空白处,右键菜单,添加链接需要显示,其他和pro mac一样的效果,不显示属性栏
|
|
|
+
|
|
|
+ //isRightMenuAddAnnot = true;
|
|
|
+ //if (str != AddAnnotType.AnnotLink.ToString())
|
|
|
+ //{
|
|
|
+ // ShowPropertyPanel(false);
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // ShowPropertyPanel(true);
|
|
|
+ //}
|
|
|
+
|
|
|
+ #endregion 设计重新调整,阅读页空白处,右键菜单,添加链接需要显示,其他和pro mac一样的效果,不显示属性栏
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 选择文本、图片,右键菜单
|
|
|
/// </summary>
|
|
@@ -1002,7 +1080,8 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
|
|
|
case "StickyNote"://便签
|
|
|
StickyAnnotArgs stickyAnnotArgs = (StickyAnnotArgs)GetStickyNote();
|
|
|
- stickyAnnotArgs.ClientRect = annotCommand.TextRect;
|
|
|
+ //stickyAnnotArgs.ClientRect = annotCommand.TextRect;
|
|
|
+ stickyAnnotArgs.ClientRect = new Rect(annotCommand.TextRect.X, annotCommand.TextRect.Y - annotCommand.TextRect.Height, annotCommand.TextRect.Width, annotCommand.TextRect.Height);
|
|
|
stickyAnnotArgs.StickyNote = annotCommand.Text;
|
|
|
PDFViewer.CreatePageAnnot(annotCommand.PageIndex, stickyAnnotArgs);
|
|
|
break;
|