|
|
thank you,very good
|
|
|
you have two ways to create an underline annotation 1. Code:
var page = pdfViewer1.Document.Pages[0];
if (page.Annots == null)
page.CreateAnnotations();
page.Annots.Add(new PdfUnderlineAnnotation(page, new FS_POINTF(40, 450), new FS_POINTF(140, 490), new FS_POINTF(130, 400), new FS_POINTF(30, 360), FS_COLOR.Black));
page.Dispose();
2. Code:
var underlineAnnotWithoutAppearance = new PdfUnderlineAnnotation(page);
underlineAnnotWithoutAppearance.Color = FS_COLOR.Blue;
underlineAnnotWithoutAppearance.Opacity = 1.0f;
underlineAnnotWithoutAppearance.QuadPoints = new PdfQuadPointsCollection();
underlineAnnotWithoutAppearance.QuadPoints.Add(new FS_QUADPOINTSF(20, 40, 120, 40, 20, 10, 120, 10));
underlineAnnotWithoutAppearance.QuadPoints.Add(new FS_QUADPOINTSF(130, 80, 300, 180, 140, 10, 250, 40));
page.Annots.Add(underlineAnnotWithoutAppearance);
underlineAnnotWithoutAppearance.RegenerateAppearances();
page.Dispose();
|
|
|
hi: Code:Private Sub addUnderlineannot(ByVal page As PdfPage,byval rect As FS_RECTF)
If page.Annots Is Nothing Then page.CreateAnnotations()
Dim pathobj =PdfPathObject.Create(FillModes.Winding,True)
pathObj.Path.AppendRect(rect)
pathObj.StrokeColor = FS_COLOR.Transparent
pathObj.FillColor = FS_COLOR.Transparent
pathObj.CalcBoundingBox()
Dim annot As PdfTextMarkupAnnotation
annot=New PdfUnderlineAnnotation(page)
annot.Color = FS_COLOR.Black
annot.Opacity = 1.0f
annot.Rectangle = rect
annot.QuadPoints.add((new FS_QUADPOINTSF(rect)))
annot.CreateEmptyAppearance(AppearanceStreamModes.Normal)
annot.NormalAppearance.Add(pathobj)
annot.GenerateAppearance(AppearanceStreamModes.Normal)
page.annots.Add(annot)
page.Dispose()
End Sub
1、Object reference is not set to an instance of the object 2、Don't show the underline(Delete this line annot.QuadPoints.add((new FS_QUADPOINTSF(rect))))
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close