Ejemplo n.º 1
0
        public void CreateAnnotationTest()
        {
            Annotation annotation = new Annotation("500");

            annotation.AddCreator("Stefan Weber");
            annotation.AddGenerator("My super duper app");
            annotation.AddBodyElement("Ich bin ein Text", Purpose.Commenting);
            annotation.AddPdfTextMarkupTarget("83743", PdfAnnotationType.Highlight, null, null, "Ich bin der Text");

            var options = new JsonSerializerOptions();

            options.PropertyNamingPolicy   = JsonNamingPolicy.CamelCase;
            options.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;
            var result = JsonSerializer.Serialize(annotation, options);
        }