|
@@ -430,7 +430,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
private bool isLoaded = false;
|
|
|
private bool isMail = false;
|
|
|
private bool isSelected = false;
|
|
|
-
|
|
|
+ private bool IsAnnotSelect = true;
|
|
|
private string historyBtnGOorBackTag = string.Empty;
|
|
|
private int totalPage = 0;
|
|
|
private int backPageIndex = 0;
|
|
@@ -590,11 +590,16 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ BtnLocationIsEnabled = true;
|
|
|
ImagePreviewVisibility = Visibility.Collapsed;
|
|
|
BtnGOorBackVisibility = Visibility.Collapsed;
|
|
|
isSelected = false;
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ BtnLocationIsEnabled = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -686,6 +691,16 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
/// <param name="obj"></param>
|
|
|
private void LocationPage(object obj)
|
|
|
{
|
|
|
+ //没有选择注释工具、也不是右键添加注释
|
|
|
+ //在阅读页,选择注释后,点击按钮
|
|
|
+ //需要设置相关参数
|
|
|
+ if (AnnotAttribEvent.IsAnnotCreateReset == false)
|
|
|
+ {
|
|
|
+ pdfViewer.SetMouseMode(MouseModes.AnnotCreate);
|
|
|
+ pdfViewer.SetToolParam(linkAnnotArgs);
|
|
|
+ IsAnnotSelect = false;
|
|
|
+ }
|
|
|
+
|
|
|
pdfViewer.EnableDrawSelectArea(true);
|
|
|
historyPageIndex = pdfViewer.CurrentIndex;
|
|
|
PageNumTextIsEnabled = false;
|
|
@@ -708,8 +723,62 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
{
|
|
|
region.RequestNavigate(viewContentViewModel.TipContentRegionName, "LinkAnnotTip");
|
|
|
}
|
|
|
- //if(string.IsNullOrEmpty(PageNumTextContent))
|
|
|
+
|
|
|
viewContentViewModel.ShowTip(true);
|
|
|
+ //AnnotAttribEvent.IsAnnotCreateReset = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 定位目标范围完成时,触发
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="sender"></param>
|
|
|
+ /// <param name="e"></param>
|
|
|
+ private async void PDFViewer_CustomNotifyHandler(object sender, CustomNotityData e)
|
|
|
+ {
|
|
|
+ if (e.NotifyType == CustomNotifyType.LinkAreaLocate)
|
|
|
+ {
|
|
|
+ if (e.NotifyData is AreaLocate areaInfo)
|
|
|
+ {
|
|
|
+ if (pdfViewer.ToolManager.CurrentAnnotArgs.EventType == AnnotArgsType.AnnotLink && pdfViewer.MouseMode == MouseModes.AnnotCreate)
|
|
|
+ {
|
|
|
+ LinkAnnotArgs linkArgs = pdfViewer.ToolManager.CurrentAnnotArgs as LinkAnnotArgs;
|
|
|
+ System.Windows.Size pageSize = pdfViewer.Document.GetPageSize(areaInfo.PageIndex);
|
|
|
+ linkArgs.IsPositionSet = true;
|
|
|
+ linkArgs.DestIndex = areaInfo.PageIndex;
|
|
|
+ linkArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
|
|
|
+
|
|
|
+ historyPageIndex = linkArgs.PageIndex;
|
|
|
+ LinkAnnotArgs = linkArgs;
|
|
|
+ //LinkAnnotArgs.PageIndex = historyPageIndex;
|
|
|
+
|
|
|
+ AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
|
+ AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
|
|
|
+ AnnotAttribEvent?.UpdateAnnot();
|
|
|
+
|
|
|
+ LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
+
|
|
|
+ PageNumTextContent = (areaInfo.PageIndex + 1).ToString();
|
|
|
+ SetImagePreview(areaInfo.PageIndex);
|
|
|
+
|
|
|
+ //viewContentViewModel.LinkAnnotTipVisibility = Visibility.Collapsed;
|
|
|
+ viewContentViewModel.TipVisible = Visibility.Collapsed;
|
|
|
+ BtnLocationIsChecked = false;
|
|
|
+
|
|
|
+ //没有选择注释工具、也不是右键添加注释
|
|
|
+ //在阅读页,选择注释后,点击按钮
|
|
|
+ //需要设置相关参数
|
|
|
+ if (IsAnnotSelect == false)
|
|
|
+ {
|
|
|
+ pdfViewer.SetMouseMode(MouseModes.PanTool);
|
|
|
+ }
|
|
|
+
|
|
|
+ await System.Threading.Tasks.Task.Delay(2);
|
|
|
+ SelectAnnotation();
|
|
|
+
|
|
|
+ pdfViewer.GoToPage(historyPageIndex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1049,6 +1118,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
if (AnnotAttribEvent.IsAnnotCreateReset == false)
|
|
|
{
|
|
|
+ //根据选择的,链接,获取对应的信息
|
|
|
GetAnnotAttribute();
|
|
|
}
|
|
|
|
|
@@ -1082,49 +1152,6 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 定位目标范围完成时,触发
|
|
|
- /// </summary>
|
|
|
- /// <param name="sender"></param>
|
|
|
- /// <param name="e"></param>
|
|
|
- private async void PDFViewer_CustomNotifyHandler(object sender, CustomNotityData e)
|
|
|
- {
|
|
|
- if (e.NotifyType == CustomNotifyType.LinkAreaLocate)
|
|
|
- {
|
|
|
- if (e.NotifyData is AreaLocate areaInfo)
|
|
|
- {
|
|
|
- if (pdfViewer.ToolManager.CurrentAnnotArgs.EventType == AnnotArgsType.AnnotLink && pdfViewer.MouseMode == MouseModes.AnnotCreate)
|
|
|
- {
|
|
|
- LinkAnnotArgs linkArgs = pdfViewer.ToolManager.CurrentAnnotArgs as LinkAnnotArgs;
|
|
|
- System.Windows.Size pageSize = pdfViewer.Document.GetPageSize(areaInfo.PageIndex);
|
|
|
- linkArgs.IsPositionSet = true;
|
|
|
- linkArgs.DestIndex = areaInfo.PageIndex;
|
|
|
- linkArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
|
|
|
-
|
|
|
- LinkAnnotArgs = linkArgs;
|
|
|
- LinkAnnotArgs.PageIndex = historyPageIndex;
|
|
|
-
|
|
|
- AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
|
- AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
|
|
|
- AnnotAttribEvent?.UpdateAnnot();
|
|
|
-
|
|
|
- LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
-
|
|
|
- PageNumTextContent = (areaInfo.PageIndex + 1).ToString();
|
|
|
- SetImagePreview(areaInfo.PageIndex);
|
|
|
-
|
|
|
- await System.Threading.Tasks.Task.Delay(2);
|
|
|
- SelectAnnotation();
|
|
|
-
|
|
|
- pdfViewer.GoToPage(historyPageIndex);
|
|
|
- //viewContentViewModel.LinkAnnotTipVisibility = Visibility.Collapsed;
|
|
|
- viewContentViewModel.TipVisible = Visibility.Collapsed;
|
|
|
- BtnLocationIsChecked = false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 选择链接后,显示参数
|
|
|
/// </summary>
|
|
@@ -1132,6 +1159,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
{
|
|
|
if (AnnotAttribEvent.Attribs.ContainsKey(AnnotAttrib.LinkType))
|
|
|
{
|
|
|
+ //设置显示的链接模块
|
|
|
SetLinkType((LINK_TYPE)AnnotAttribEvent.Attribs[AnnotAttrib.LinkType]);
|
|
|
}
|
|
|
if (AnnotAttribEvent.Attribs.ContainsKey(AnnotAttrib.LinkDestIndx) && !AnnotAttribEvent.IsAnnotCreateReset)
|
|
@@ -1222,6 +1250,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
BtnLinkPageIsChecked = false;
|
|
|
BtnLinkMailIsChecked = false;
|
|
|
BtnLinkWebIsChecked = false;
|
|
|
+ //暂定 第一版 不显示邮箱、web链接模块
|
|
|
+ if (linkType == LINK_TYPE.URI)
|
|
|
+ {
|
|
|
+ BtnLinkPageIsChecked = true;
|
|
|
+ BtnGOorBackVisibility = Visibility.Collapsed;
|
|
|
+ return;
|
|
|
+ }
|
|
|
switch (linkType)
|
|
|
{
|
|
|
case LINK_TYPE.GOTO:
|