VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging.Pdf.Tree.Annotations Namespace / PdfLineAnnotation Class
Members Example



In This Topic
    PdfLineAnnotation Class
    In This Topic
    Represents a PDF annotation that displays a line.
    Object Model
    PdfLineAnnotation ClassPdfAction ClassPdfAnnotationAdditionalActions ClassPdfAnnotationAppearanceGenerator ClassPdfAnnotationAppearances ClassPdfFileReferenceSpecificationList ClassPdfFileReferenceSpecification ClassPdfBasicObject ClassPdfAnnotationBorderStyle ClassPdfDocument ClassPdfIndirectReference ClassPdfOptionalContentGroup ClassPdfPage Class
    Syntax
    'Declaration
     
    Public Class PdfLineAnnotation 
       Inherits PdfMarkupAnnotation
    public class PdfLineAnnotation : PdfMarkupAnnotation 
    public __gc class PdfLineAnnotation : public PdfMarkupAnnotation 
    public ref class PdfLineAnnotation : public PdfMarkupAnnotation 
    Example
    This example shows how to create a PDF line annotation.
    ''' <summary>
    ''' Creates the PDF documenet with line annotation.
    ''' </summary>
    ''' <param name="outputPdfFilename">The output PDF filename.</param>
    Public Shared Sub CreatePdfLineAnnotation(outputPdfFilename As String)
    	Using document As New Vintasoft.Imaging.Pdf.PdfDocument(outputPdfFilename, Vintasoft.Imaging.Pdf.PdfFormat.Pdf_14)
    		Dim page As Vintasoft.Imaging.Pdf.Tree.PdfPage
                
    		' Add new page
    		page = document.Pages.Add(Vintasoft.Imaging.PaperSizeKind.A4)
    		page.Annotations = New Vintasoft.Imaging.Pdf.Tree.Annotations.PdfAnnotationList(document)
    		Dim annotationRectangle As System.Drawing.RectangleF = page.MediaBox
    		annotationRectangle.Inflate(-200, -300)
                
    		' Line annotation
    		Dim line As New Vintasoft.Imaging.Pdf.Tree.Annotations.PdfLineAnnotation(page)
    		line.Rectangle = System.Drawing.RectangleF.Inflate(annotationRectangle, 30, 30)
    		line.StartPoint = annotationRectangle.Location
    		line.EndPoint = New System.Drawing.PointF(annotationRectangle.X + annotationRectangle.Width, annotationRectangle.Y + annotationRectangle.Height)
    		line.BorderWidth = 3
    		line.InteriorColor = System.Drawing.Color.Red
    		line.Color = System.Drawing.Color.Green
    		line.EndPointLineEndingStyle = Vintasoft.Imaging.Pdf.Tree.Annotations.PdfAnnotationLineEndingStyle.ClosedArrow
    		line.UpdateAppearance()
    		page.Annotations.Add(line)
                
    		document.SaveChanges()
    	End Using
    End Sub
    /// <summary>
    /// Creates the PDF documenet with line annotation.
    /// </summary>
    /// <param name="outputPdfFilename">The output PDF filename.</param>
    public static void CreatePdfLineAnnotation(string outputPdfFilename)
    {
        using (Vintasoft.Imaging.Pdf.PdfDocument document = new Vintasoft.Imaging.Pdf.PdfDocument(
            outputPdfFilename, Vintasoft.Imaging.Pdf.PdfFormat.Pdf_14))
        {
            Vintasoft.Imaging.Pdf.Tree.PdfPage page;
                
            // Add new page
            page = document.Pages.Add(Vintasoft.Imaging.PaperSizeKind.A4);
            page.Annotations = new Vintasoft.Imaging.Pdf.Tree.Annotations.PdfAnnotationList(document);
            System.Drawing.RectangleF annotationRectangle = page.MediaBox;
            annotationRectangle.Inflate(-200, -300);
                
            // Line annotation
            Vintasoft.Imaging.Pdf.Tree.Annotations.PdfLineAnnotation line = 
                new Vintasoft.Imaging.Pdf.Tree.Annotations.PdfLineAnnotation(page);
            line.Rectangle = System.Drawing.RectangleF.Inflate(annotationRectangle, 30, 30);
            line.StartPoint = annotationRectangle.Location;
            line.EndPoint = new System.Drawing.PointF(
                annotationRectangle.X + annotationRectangle.Width,
                annotationRectangle.Y + annotationRectangle.Height);
            line.BorderWidth = 3;
            line.InteriorColor = System.Drawing.Color.Red;
            line.Color = System.Drawing.Color.Green;
            line.EndPointLineEndingStyle = 
                Vintasoft.Imaging.Pdf.Tree.Annotations.PdfAnnotationLineEndingStyle.ClosedArrow;
            line.UpdateAppearance();
            page.Annotations.Add(line);
                
            document.SaveChanges();
        }
    }
    Inheritance Hierarchy

    System.Object
       Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeBase
          Vintasoft.Imaging.Pdf.Tree.Annotations.PdfAnnotation
             Vintasoft.Imaging.Pdf.Tree.Annotations.PdfMarkupAnnotation
                Vintasoft.Imaging.Pdf.Tree.Annotations.PdfLineAnnotation

    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also