|
@@ -1438,7 +1438,8 @@ namespace ComPDFKit.Tool
|
|
|
(float)rect.Top);
|
|
|
|
|
|
annotation.SetRect(cRect);
|
|
|
- if(annotation.Type!=C_ANNOTATION_TYPE.C_ANNOTATION_TEXT)
|
|
|
+ SaveSharpAnnotBoundText(annotation);
|
|
|
+ if (annotation.Type!=C_ANNOTATION_TYPE.C_ANNOTATION_TEXT)
|
|
|
{
|
|
|
annotation.UpdateAp();
|
|
|
}
|
|
@@ -1498,6 +1499,31 @@ namespace ComPDFKit.Tool
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void SaveSharpAnnotBoundText(CPDFAnnotation boundAnnot)
|
|
|
+ {
|
|
|
+ if (boundAnnot == null || boundAnnot.Page == null || boundAnnot.Page.IsValid() == false)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (boundAnnot.Type != C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE && boundAnnot.Type != C_ANNOTATION_TYPE.C_ANNOTATION_SQUARE)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ CPDFTextPage textPage= boundAnnot.Page.GetTextPage();
|
|
|
+ if (textPage == null || textPage.IsValid()==false)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ string boundText = textPage.GetBoundedText(boundAnnot.GetRect());
|
|
|
+ if(string.IsNullOrEmpty(boundText)==false)
|
|
|
+ {
|
|
|
+ boundAnnot.SetContent(boundText);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void StickyAnnot_StickyPopupClosed(object sender, EventArgs e)
|
|
|
{
|
|
|
StickyNoteAnnot.StickyPopupClosed -= StickyAnnot_StickyPopupClosed;
|