Add the border in the specific area using PDFTron.net

95 views
Skip to first unread message

BMW

unread,
Nov 4, 2013, 5:53:56 PM11/4/13
to pdfne...@googlegroups.com
Hi,
I have listed all annotations in the comment panel as same as the Comment panel in Adobe Reader. I also know how to show the page.
 However, I need to add the border on that annotation. Is it any sample project  or would you tell me the code example or process.  thanks in advance.
 

Support

unread,
Nov 4, 2013, 6:33:01 PM11/4/13
to
 
How about using annot.SetBorderStyle(bs).
 
pdftron.PDF.Annot.BorderStyle:
 
Don't forget to call annot.RefreshAppearance() any time you finish modifying properties on an annotation

BMW

unread,
Nov 5, 2013, 1:50:27 PM11/5/13
to pdfne...@googlegroups.com
Thanks for respond. I tried the SetBorderStyle, but it is only work on e_freeText in my code and the borderstyle is solid. By the way, I only want to see it on screen, not actually add it on the annotation. If I use the SetBorderStyle method, how I move it back when the user click on any area on my form?
 
the following is my code to add the border as you mentioned.

switch (commentAnnot.GetType())

{
   

case Annot.Type.e_Text:

 case Annot.Type.e_Highlight:
 case Annot.Type.e_Line:
 case Annot.Type.e_Squiggly:
 case Annot.Type.e_Underline:
 case Annot.Type.e_FreeText:
 case Annot.Type.e_Caret:

commentAnnot.SetBorderStyle(new Annot.BorderStyle(Annot.BorderStyle.Style.e_dashed, 1));
commentAnnot.RefreshAppearance();

 

 

}
 
 
On Monday, November 4, 2013 3:32:46 PM UTC-8, Support wrote:
 
How about using annot.SetBorderStyle(bs).
 
pdftron.PDF.Annot.BorderStyle:
 
Don't forget to call annot.RefreshAppearance() any time you finish modifying properties on an annotation
 

On Monday, November 4, 2013 2:53:56 PM UTC-8, BMW wrote:

Support

unread,
Nov 5, 2013, 2:17:16 PM11/5/13
to pdfne...@googlegroups.com
 
I tested SetBorderStyle() and it seems to work on all annotation types.
 
Having said this it seems that your requirements changed (it seems that after all you don't want to add the border to the annot itself). In this case you need to draw a rectangle on top of PDFViewCtrl. You can use PDFViewCtrl.ConvPagePtToScreenPt() to convert page coordinates into screen/client cords.
 
The details vary from platform to platform.
Reply all
Reply to author
Forward
0 new messages