PdfAnnotationDataConverterConvertAnnotationDataToPdf Method (AnnotationDataCollection, AnnotationUnit, Dpi, PdfDocumentSigner, PdfUnknownAnnotationHandler) |
var rectData = new RectangleData() { Size = new SizeF(123, 345), Location = new PointF(123, 321), Fill = new AnnotationBrush(Color.FromArgb(255, 64, 128, 255)), Outline = new AnnotationPen(Color.FromArgb(255, 128, 128, 128)) }; var polyData = new PolygonData() { Size = new SizeF(100, 200), Location = new PointF(10, 11), Fill = new AnnotationBrush(Color.FromArgb(255, 64, 128, 255)), Outline = new AnnotationPen(Color.FromArgb(255, 128, 128, 128)) }; polyData.Points.AddRange(new[] { new PointF(1, 1), new PointF(50, 50), new PointF(1, 50) }); var collection = new AnnotationDataCollection() { new LayerData() { Items = { rectData, polyData } } }; var dpis = new[] { new Dpi(96, 96, ResolutionUnit.DotsPerInch) }; var signer = new PdfDocumentSigner(pdfStream, null); var pagesOfAnnots = PdfAnnotationDataConverter.ConvertAnnotationDataToPdf(collection, AnnotationUnit.Pixel, dpis, signer); for (var i = 0; i < pagesOfAnnots.Count; i++) foreach (var annotation in pagesOfAnnots[i]) signer.PagesOfAnnotations[i].Add(annotation); signer.AppendChangesFinal(true);
Namespace: Atalasoft.dotImage.PdfDoc.Bridge.Annotate
public static List<List<BaseAnnotation>> ConvertAnnotationDataToPdf( AnnotationDataCollection layers, AnnotationUnit units, Dpi[] resolutions, PdfDocumentSigner signer, PdfUnknownAnnotationHandler handler = null )