|
@@ -775,7 +775,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
/// <param name="e"></param>
|
|
- private async void PDFViewer_CustomNotifyHandler(object sender, CustomNotityData e)
|
|
|
|
|
|
+ private void PDFViewer_CustomNotifyHandler(object sender, CustomNotityData e)
|
|
{
|
|
{
|
|
if (e.NotifyType == CustomNotifyType.LinkAreaLocate)
|
|
if (e.NotifyType == CustomNotifyType.LinkAreaLocate)
|
|
{
|
|
{
|
|
@@ -790,19 +790,33 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
if (pdfViewer.ToolManager.CurrentAnnotArgs.EventType == AnnotArgsType.AnnotLink && pdfViewer.MouseMode == MouseModes.AnnotCreate)
|
|
if (pdfViewer.ToolManager.CurrentAnnotArgs.EventType == AnnotArgsType.AnnotLink && pdfViewer.MouseMode == MouseModes.AnnotCreate)
|
|
{
|
|
{
|
|
LinkAnnotArgs linkArgs = pdfViewer.ToolManager.CurrentAnnotArgs as LinkAnnotArgs;
|
|
LinkAnnotArgs linkArgs = pdfViewer.ToolManager.CurrentAnnotArgs as LinkAnnotArgs;
|
|
|
|
+ if (linkArgs.AnnotIndex == -1)
|
|
|
|
+ {
|
|
|
|
+ linkArgs = (LinkAnnotArgs)propertyPanel.annot;
|
|
|
|
+ }
|
|
|
|
+
|
|
System.Windows.Size pageSize = pdfViewer.Document.GetPageSize(areaInfo.PageIndex);
|
|
System.Windows.Size pageSize = pdfViewer.Document.GetPageSize(areaInfo.PageIndex);
|
|
linkArgs.IsPositionSet = true;
|
|
linkArgs.IsPositionSet = true;
|
|
linkArgs.DestIndex = areaInfo.PageIndex;
|
|
linkArgs.DestIndex = areaInfo.PageIndex;
|
|
linkArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
|
|
linkArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
|
|
|
|
+ //linkArgs.AnnotIndex = LinkAnnotArgs.AnnotIndex;
|
|
|
|
+ //linkArgs.PageIndex = LinkAnnotArgs.PageIndex;
|
|
|
|
|
|
- historyPageIndex = linkArgs.PageIndex;
|
|
|
|
- LinkAnnotArgs = linkArgs;
|
|
|
|
|
|
+ historyPageIndex = LinkAnnotArgs.PageIndex;
|
|
|
|
+ //LinkAnnotArgs = linkArgs;
|
|
|
|
+ //if (linkArgs.AnnotIndex == -1)
|
|
|
|
+ //{
|
|
|
|
+ // LinkAnnotArgs.IsPositionSet = true;
|
|
|
|
+ // LinkAnnotArgs.DestIndex = areaInfo.PageIndex;
|
|
|
|
+ // LinkAnnotArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
|
|
|
|
+ // LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
|
+ //}
|
|
|
|
|
|
AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
|
|
AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
|
|
AnnotAttribEvent?.UpdateAnnot();
|
|
AnnotAttribEvent?.UpdateAnnot();
|
|
|
|
|
|
- LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
|
|
|
+ linkArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
|
|
|
PageNumTextContent = (areaInfo.PageIndex + 1).ToString();
|
|
PageNumTextContent = (areaInfo.PageIndex + 1).ToString();
|
|
SetImagePreview(areaInfo.PageIndex);
|
|
SetImagePreview(areaInfo.PageIndex);
|
|
@@ -821,8 +835,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
//await System.Threading.Tasks.Task.Delay(5);
|
|
//await System.Threading.Tasks.Task.Delay(5);
|
|
pdfViewer.GoToPage(historyPageIndex);
|
|
pdfViewer.GoToPage(historyPageIndex);
|
|
|
|
|
|
- await System.Threading.Tasks.Task.Delay(5);
|
|
|
|
- pdfViewer.SelectAnnotation(LinkAnnotArgs.PageIndex, LinkAnnotArgs.AnnotIndex);
|
|
|
|
|
|
+ //await System.Threading.Tasks.Task.Delay(5);
|
|
|
|
+ //pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
|
|
|
|
|
|
BtnLocationIsChecked = false;
|
|
BtnLocationIsChecked = false;
|
|
//}
|
|
//}
|
|
@@ -1195,10 +1209,17 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
{
|
|
{
|
|
if (pdfViewer != null && pdfViewer.ToolManager != null && pdfViewer.ToolManager.CurrentAnnotArgs?.EventType == AnnotArgsType.AnnotLink)
|
|
if (pdfViewer != null && pdfViewer.ToolManager != null && pdfViewer.ToolManager.CurrentAnnotArgs?.EventType == AnnotArgsType.AnnotLink)
|
|
{
|
|
{
|
|
|
|
+ LinkAnnotArgs = pdfViewer.ToolManager.CurrentAnnotArgs as LinkAnnotArgs;
|
|
|
|
+ if (LinkAnnotArgs.AnnotIndex == -1)
|
|
|
|
+ {
|
|
|
|
+ LinkAnnotArgs = (LinkAnnotArgs)propertyPanel.annot;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (btnGOorBack != null)
|
|
if (btnGOorBack != null)
|
|
{
|
|
{
|
|
ChangeBtnGOorBack("GO", btnGOorBack);
|
|
ChangeBtnGOorBack("GO", btnGOorBack);
|
|
}
|
|
}
|
|
|
|
+
|
|
if (AnnotAttribEvent.IsAnnotCreateReset)
|
|
if (AnnotAttribEvent.IsAnnotCreateReset)
|
|
{
|
|
{
|
|
LinkAnnotArgs = pdfViewer.ToolManager.CurrentAnnotArgs as LinkAnnotArgs;
|
|
LinkAnnotArgs = pdfViewer.ToolManager.CurrentAnnotArgs as LinkAnnotArgs;
|
|
@@ -1213,19 +1234,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (pdfViewer != null && pdfViewer.ToolManager != null && pdfViewer.ToolManager.CurrentAnnotArgs?.EventType == AnnotArgsType.AnnotLink)
|
|
|
|
- {
|
|
|
|
- LinkAnnotArgs = pdfViewer.ToolManager.CurrentAnnotArgs as LinkAnnotArgs;
|
|
|
|
- if (LinkAnnotArgs == null)
|
|
|
|
- {
|
|
|
|
- LinkAnnotArgs = (LinkAnnotArgs)propertyPanel.annot;
|
|
|
|
- backPageIndex = pdfViewer.CurrentIndex;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- LinkAnnotArgs.PageIndex = pdfViewer.CurrentIndex;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
if (LinkAnnotArgs == null)
|
|
if (LinkAnnotArgs == null)
|
|
{
|
|
{
|
|
LinkAnnotArgs = (LinkAnnotArgs)propertyPanel.annot;
|
|
LinkAnnotArgs = (LinkAnnotArgs)propertyPanel.annot;
|