Atalasoft.Annotate.Exporters.PdfAnnotationDataExporter documentAnnotationViewer1_CreatePdfAnnotationDataExporter(object sender, CreatePdfAnnotationDataExporterEventArgs e) { PdfAnnotationDataExporter exp = new PdfAnnotationDataExporter(); exp.AlwaysEmbedAnnotationData = true; exp.OverwriteExistingAnnotations = true; return(exp); }
private void SavePdfAnnotations(string fileName) { using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)) { PdfAnnotationDataExporter exp = new PdfAnnotationDataExporter(); System.Drawing.Size sz = this.AnnotationViewer.ImageViewer.Image.Size; SizeF pageSize = new SizeF(sz.Width, sz.Height); Dpi resolution = this.AnnotationViewer.ImageViewer.Image.Resolution; LayerData data = (LayerData)this.AnnotationViewer.Annotations.CurrentLayer.CreateDataSnapshot(); exp.ExportOver(fs, pageSize, AnnotationUnit.Pixel, resolution, data, 0); } }