internal static List <PDFAnnotation> GenerateAnnotations(PDFDocument pdf_document, int page, PDFInkList ink_list) { List <RegionOfInterest> regions = new List <RegionOfInterest>(); // Collect all the highlights on this page StrokeCollection stroke_collection = ink_list.GetInkStrokeCollection(page); if (null != stroke_collection) { foreach (Stroke stroke in stroke_collection) { double SCALE = 1000.0; Rect bound = stroke.GetBounds(); bound.X /= SCALE; bound.Y /= SCALE; bound.Width /= SCALE; bound.Height /= SCALE; regions.Add(new RegionOfInterest(bound.Left, bound.Top, bound.Width, bound.Height)); } } RegionOfInterest.AggregateRegions(regions); // Build a list of annotations List <PDFAnnotation> annotations = RegionOfInterest.ConvertRegionsToPDFAnnotations(regions, INKS_TAG, pdf_document, page); return(annotations); }
private void RebuildInks(int page, PDFInkList pdf_ink_list) { StrokeCollection stroke_collection = pdf_ink_list.GetInkStrokeCollection(page); if (null != stroke_collection) { ObjInkCanvas.Strokes = stroke_collection; } }