VintaSoft Imaging .NET SDK 14.0: Документация для .NET разработчика
Vintasoft.Imaging.Pdf.Tree.Annotations Namespace / PdfSquareAnnotation Class
Члены типа Объект Синтаксис Example Иерархия Требования Смотрите также
В этом разделе
    Класс PdfSquareAnnotation
    В этом разделе
    Представляет PDF аннотацию, отображающую квадрат.
    Объектная модель
    PdfAnnotationBorderEffect PaddingF PdfPopupAnnotation PdfAnnotation PdfFileReferenceSpecificationList PdfAnnotationAppearanceGenerator PdfOptionalContentGroup PdfPage PdfAnnotationBorderStyle AffineMatrix PdfAction PdfAnnotationAppearances PdfAnnotationAdditionalActions PdfDocument PdfIndirectReference PdfBasicObject PdfSquareAnnotation
    Синтаксис
    'Declaration
    
    Public Class PdfSquareAnnotation
       Inherits PdfRectangularAnnotation
    
    
    public class PdfSquareAnnotation : PdfRectangularAnnotation
    
    
    public __gc class PdfSquareAnnotation : public PdfRectangularAnnotation*
    
    
    public ref class PdfSquareAnnotation : public PdfRectangularAnnotation^
    
    
    Пример

    Вот пример, показывающий, как создать квадратную PDF аннотацию:

    
    ''' <summary>
    ''' Creates the PDF documenet with square annotation.
    ''' </summary>
    ''' <param name="outputPdfFilename">The output PDF filename.</param>
    Public Shared Sub CreatePdfSquareAnnotation(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)
    
            ' Square annotation
            Dim square As New Vintasoft.Imaging.Pdf.Tree.Annotations.PdfSquareAnnotation(page)
            square.Rectangle = annotationRectangle
            square.BorderWidth = 3
            square.Padding = New Vintasoft.Imaging.PaddingF(square.BorderWidth)
            square.InteriorColor = System.Drawing.Color.Red
            square.Color = System.Drawing.Color.Green
            square.UpdateAppearance()
            page.Annotations.Add(square)
    
            document.SaveChanges()
        End Using
    End Sub
    
    
    
    /// <summary>
    /// Creates the PDF documenet with square annotation.
    /// </summary>
    /// <param name="outputPdfFilename">The output PDF filename.</param>
    public static void CreatePdfSquareAnnotation(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);
    
            // Square annotation
            Vintasoft.Imaging.Pdf.Tree.Annotations.PdfSquareAnnotation square = 
                new Vintasoft.Imaging.Pdf.Tree.Annotations.PdfSquareAnnotation(page);
            square.Rectangle = annotationRectangle;
            square.BorderWidth = 3;
            square.Padding = new Vintasoft.Imaging.PaddingF(square.BorderWidth);
            square.InteriorColor = System.Drawing.Color.Red;
            square.Color = System.Drawing.Color.Green;
            square.UpdateAppearance();
            page.Annotations.Add(square);
    
            document.SaveChanges();
        }
    }
    
    

    Иерархия наследования

    System.Object
       Vintasoft.Imaging.Pdf.Tree.PdfTreeNodeBase
          Vintasoft.Imaging.Pdf.Tree.Annotations.PdfAnnotation
             Vintasoft.Imaging.Pdf.Tree.Annotations.PdfMarkupAnnotation
                Vintasoft.Imaging.Pdf.Tree.Annotations.PdfRectangularAnnotation
                   Vintasoft.Imaging.Pdf.Tree.Annotations.PdfSquareAnnotation

    Требования

    Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также