/// <summary> /// Burns the annotations on PDF page with vector graphics. /// </summary> /// <param name="annotations">The annotations.</param> /// <param name="resolution">The resolution.</param> /// <param name="page">The page.</param> private static void BurnPdfAnnotations( AnnotationDataCollection annotations, Resolution resolution, PdfPage page) { PdfAnnotation[] annots = AnnotationConverter.ConvertToPdfAnnotations(annotations, resolution, page); using (PdfGraphics g = page.GetGraphics()) foreach (PdfAnnotation annot in annots) { g.DrawAnnotation(annot); } }
public void Test() { var mph = new IdentifiedSpectrum(); var io = new AnnotationConverter<IdentifiedSpectrum>("TEST"); Assert.AreEqual("TEST", io.Name); Assert.AreEqual("", io.GetProperty(mph)); io = new AnnotationConverter<IdentifiedSpectrum>("TEST", "DEFAULT_VALUE"); Assert.AreEqual("DEFAULT_VALUE", io.GetProperty(mph)); io.SetProperty(mph, "TEST_VALUE"); Assert.AreEqual("TEST_VALUE", io.GetProperty(mph)); Assert.AreEqual("TEST_VALUE", mph.Annotations["TEST"]); }
public void Test() { var mph = new IdentifiedSpectrum(); var io = new AnnotationConverter <IdentifiedSpectrum>("TEST"); Assert.AreEqual("TEST", io.Name); Assert.AreEqual("", io.GetProperty(mph)); io = new AnnotationConverter <IdentifiedSpectrum>("TEST", "DEFAULT_VALUE"); Assert.AreEqual("DEFAULT_VALUE", io.GetProperty(mph)); io.SetProperty(mph, "TEST_VALUE"); Assert.AreEqual("TEST_VALUE", io.GetProperty(mph)); Assert.AreEqual("TEST_VALUE", mph.Annotations["TEST"]); }