|
@@ -1085,14 +1085,19 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
//stickyAnnotArgs.ClientRect = new Rect(textSelectNodes[0].StartPoint.X, annotCommand.TextRect.Y - annotCommand.TextRect.Height, annotCommand.TextRect.Width, annotCommand.TextRect.Height);
|
|
|
Rect rect = annotCommand.TextRectList[0];
|
|
|
|
|
|
- int dpi = DpiHelpers.Dpi;
|
|
|
- double x = rect.X / 72D * dpi;
|
|
|
- double y = (rect.Y - rect.Height) / 72D * dpi;
|
|
|
- double width = rect.Width / 72D * dpi;
|
|
|
- double height = rect.Height / 72D * dpi;
|
|
|
+ #region to do 转dpi
|
|
|
|
|
|
- stickyAnnotArgs.ClientRect = new Rect(x, y, width, height);
|
|
|
+ //int dpi = DpiHelpers.Dpi;
|
|
|
+ //double x = rect.X / 72D * dpi;
|
|
|
+ //double y = (rect.Y - rect.Height) / 72D * dpi;
|
|
|
+ //double width = rect.Width / 72D * dpi;
|
|
|
+ //double height = rect.Height / 72D * dpi;
|
|
|
+
|
|
|
+ #endregion to do 转dpi
|
|
|
+
|
|
|
+ //stickyAnnotArgs.ClientRect = new Rect(x, y, width, height);
|
|
|
//stickyAnnotArgs.ClientRect = new Rect(rect.X, rect.Y - rect.Height, rect.Width, rect.Height);
|
|
|
+ stickyAnnotArgs.ClientRect = rect;
|
|
|
//PDFViewer.CreatePageAnnot(annotCommand.PageIndex, stickyAnnotArgs);
|
|
|
NavigationParameters param = new NavigationParameters();
|
|
|
param.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
@@ -1605,38 +1610,43 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
{
|
|
|
var menu = obj as CusMenuItem;
|
|
|
var annot = menu.Parameter as AnnotHandlerEventArgs;
|
|
|
- if (annot != null)
|
|
|
- {
|
|
|
- AnnotationHandlerEventArgs args = new AnnotationHandlerEventArgs();
|
|
|
-
|
|
|
- args.ClientRect = annot.ClientRect;
|
|
|
- args.AnnotHandlerEventArgs = annot;
|
|
|
- args.PageIndex = annot.PageIndex;
|
|
|
- args.AnnotIndex = annot.AnnotIndex;
|
|
|
- args.EventType = annot.EventType;
|
|
|
- args.CreateTime = annot.CreateTime;
|
|
|
- args.UpdateTime = annot.UpdateTime;
|
|
|
- args.Content = annot.Content;
|
|
|
- args.MarkupContent = annot.MarkupContent;
|
|
|
- args.Author = annot.Author;
|
|
|
- args.Locked = annot.Locked;
|
|
|
- args.ReadOnly = annot.ReadOnly;
|
|
|
- args.FormField = annot.FormField;
|
|
|
- args.Document = PDFViewer.Document;
|
|
|
-
|
|
|
- DialogParameters value = new DialogParameters();
|
|
|
- value.Add(ParameterNames.Annotation, args);
|
|
|
- dialogs.ShowDialog(DialogNames.AddAnnotationDialog, value, e =>
|
|
|
- {
|
|
|
- if (e.Result == ButtonResult.OK && e.Parameters != null)
|
|
|
- {
|
|
|
- PDFViewer.UndoManager.CanSave = true;
|
|
|
- if (e.Parameters.ContainsKey(ParameterNames.Annotation) && e.Parameters.ContainsKey(ParameterNames.AnnotEvent))
|
|
|
- {
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ PopAnnotNoteText(annot);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void PopAnnotNoteText(AnnotHandlerEventArgs annot)
|
|
|
+ {
|
|
|
+ if (annot != null)
|
|
|
+ {
|
|
|
+ AnnotationHandlerEventArgs args = new AnnotationHandlerEventArgs();
|
|
|
+
|
|
|
+ args.ClientRect = annot.ClientRect;
|
|
|
+ args.AnnotHandlerEventArgs = annot;
|
|
|
+ args.PageIndex = annot.PageIndex;
|
|
|
+ args.AnnotIndex = annot.AnnotIndex;
|
|
|
+ args.EventType = annot.EventType;
|
|
|
+ args.CreateTime = annot.CreateTime;
|
|
|
+ args.UpdateTime = annot.UpdateTime;
|
|
|
+ args.Content = annot.Content;
|
|
|
+ args.MarkupContent = annot.MarkupContent;
|
|
|
+ args.Author = annot.Author;
|
|
|
+ args.Locked = annot.Locked;
|
|
|
+ args.ReadOnly = annot.ReadOnly;
|
|
|
+ args.FormField = annot.FormField;
|
|
|
+ args.Document = PDFViewer.Document;
|
|
|
+
|
|
|
+ DialogParameters value = new DialogParameters();
|
|
|
+ value.Add(ParameterNames.Annotation, args);
|
|
|
+ dialogs.ShowDialog(DialogNames.AddAnnotationDialog, value, e =>
|
|
|
+ {
|
|
|
+ if (e.Result == ButtonResult.OK && e.Parameters != null)
|
|
|
+ {
|
|
|
+ PDFViewer.UndoManager.CanSave = true;
|
|
|
+ if (e.Parameters.ContainsKey(ParameterNames.Annotation) && e.Parameters.ContainsKey(ParameterNames.AnnotEvent))
|
|
|
+ {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|