VintaSoft Imaging .NET SDK 11.0
Vintasoft.Imaging.Pdf.Tree.Annotations Namespace / PdfCircleAnnotation Class
Members Example



In This Topic
    PdfCircleAnnotation Class
    In This Topic
    Represents a PDF annotation that displays a circle.
    Object Model
    PdfCircleAnnotation ClassPdfAction ClassPdfAnnotationAdditionalActions ClassPdfAnnotationAppearanceGenerator ClassAffineMatrix ClassPdfAnnotationAppearances ClassPdfFileReferenceSpecificationList ClassPdfFileReferenceSpecification ClassPdfBasicObject ClassPdfAnnotationBorderEffect ClassPdfAnnotationBorderStyle ClassPdfDocument ClassPdfIndirectReference ClassPdfOptionalContentGroup ClassPaddingF StructurePdfPage ClassPdfPopupAnnotation ClassPdfAnnotation Class
    Syntax
    'Declaration
     
    Public NotInheritable Class PdfCircleAnnotation 
       Inherits PdfRectangularAnnotation
    public sealed class PdfCircleAnnotation : PdfRectangularAnnotation 
    public __gc __sealed class PdfCircleAnnotation : public PdfRectangularAnnotation 
    public ref class PdfCircleAnnotation sealed : public PdfRectangularAnnotation 
    Example
    Here is an example that shows how to create a PDF circle annotation:
    ''' <summary>
    ''' Creates the PDF documenet with circle annotation.
    ''' </summary>
    ''' <param name="outputPdfFilename">The output PDF filename.</param>
    Public Shared Sub CreatePdfCircleAnnotation(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)
                
            ' Circle annotation
            Dim circle As New Vintasoft.Imaging.Pdf.Tree.Annotations.PdfCircleAnnotation(page)
            circle.Rectangle = annotationRectangle
            circle.BorderWidth = 3
            circle.Padding = New Vintasoft.Imaging.PaddingF(circle.BorderWidth)
            circle.InteriorColor = System.Drawing.Color.Red
            circle.Color = System.Drawing.Color.Green
            circle.UpdateAppearance()
            page.Annotations.Add(circle)
                
            document.SaveChanges()
        End Using
    End Sub
    /// <summary>
    /// Creates the PDF documenet with circle annotation.
    /// </summary>
    /// <param name="outputPdfFilename">The output PDF filename.</param>
    public static void CreatePdfCircleAnnotation(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);
                
            // Circle annotation
            Vintasoft.Imaging.Pdf.Tree.Annotations.PdfCircleAnnotation circle = 
                new Vintasoft.Imaging.Pdf.Tree.Annotations.PdfCircleAnnotation(page);
            circle.Rectangle = annotationRectangle;
            circle.BorderWidth = 3;
            circle.Padding = new Vintasoft.Imaging.PaddingF(circle.BorderWidth);
            circle.InteriorColor = System.Drawing.Color.Red;
            circle.Color = System.Drawing.Color.Green;
            circle.UpdateAppearance();
            page.Annotations.Add(circle);
            
            document.SaveChanges();
        }
    }
    Inheritance Hierarchy
    Requirements

    Target Platforms: .NET 6; .NET 5; .NET Core 3.1; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also