private static pdftron.PDF.Annots.Square setSquare(Square sq) { pdftron.PDF.Rect r = AnnotationsMannager.ConvertRect(sq.RectArea()); pdftron.PDF.Annots.Square s = pdftron.PDF.Annots.Square.Create(_currentDoc, r); return(s); }
private static pdftron.PDF.Annots.Circle setCircle(Circle c) { pdftron.PDF.Rect r = AnnotationsMannager.ConvertRect(c.RectArea()); pdftron.PDF.Annots.Circle circle = pdftron.PDF.Annots.Circle.Create(_currentDoc, r); return(circle); }
private static Squiggly setSquiggly(XMLSquiggly xsq) { pdftron.PDF.Rect r = AnnotationsMannager.ConvertRect(xsq.RectArea()); Squiggly sq = Squiggly.Create(_currentDoc, r); return(sq); }
private static Highlight setHighlight(BaseAnnotation xhl) //I need it to work for both Area and Text Highlights { pdftron.PDF.Rect r = AnnotationsMannager.ConvertRect(xhl.RectArea()); Highlight hl = Highlight.Create(_currentDoc, r); return(hl); }
private static pdftron.PDF.Annots.Line setLine(Line xl) { pdftron.PDF.Rect r = AnnotationsMannager.ConvertRect(xl.RectArea()); pdftron.PDF.Annots.Line l = pdftron.PDF.Annots.Line.Create(_currentDoc, r); l.SetStartPoint(new pdftron.PDF.Point(xl.XStart(), xl.YStart())); l.SetEndPoint(new pdftron.PDF.Point(xl.XEnd(), xl.YEnd())); return(l); }
private static Ink setMarkArea(MarkArea ma) { pdftron.PDF.Rect r = AnnotationsMannager.ConvertRect(ma.RectArea()); Ink ink = Ink.Create(_currentDoc, r); pdftron.PDF.Point pt3 = new pdftron.PDF.Point(); #region Path Calculations //Bottom Path pt3.x = r.x1; pt3.y = r.y1; ink.SetPoint(0, 0, pt3); pt3.x = r.x1 + 10 * (r.x2 - r.x1) / 100; pt3.y = r.y1 + 7 * (r.y2 - r.y1) / 100; ink.SetPoint(0, 1, pt3); pt3.x = r.x1 + 20 * (r.x2 - r.x1) / 100; pt3.y = r.y1; ink.SetPoint(0, 2, pt3); pt3.x = r.x1 + 30 * (r.x2 - r.x1) / 100; pt3.y = r.y1 + 7 * (r.y2 - r.y1) / 100; ink.SetPoint(0, 3, pt3); pt3.x = r.x1 + 40 * (r.x2 - r.x1) / 100; pt3.y = r.y1; ink.SetPoint(0, 4, pt3); pt3.x = r.x1 + 50 * (r.x2 - r.x1) / 100; pt3.y = r.y1 + 7 * (r.y2 - r.y1) / 100; ink.SetPoint(0, 5, pt3); pt3.x = r.x1 + 60 * (r.x2 - r.x1) / 100; pt3.y = r.y1; ink.SetPoint(0, 6, pt3); pt3.x = r.x1 + 70 * (r.x2 - r.x1) / 100; pt3.y = r.y1 + 7 * (r.y2 - r.y1) / 100; ink.SetPoint(0, 7, pt3); pt3.x = r.x1 + 80 * (r.x2 - r.x1) / 100; pt3.y = r.y1; ink.SetPoint(0, 8, pt3); pt3.x = r.x1 + 90 * (r.x2 - r.x1) / 100; pt3.y = r.y1 + 7 * (r.y2 - r.y1) / 100; ink.SetPoint(0, 9, pt3); pt3.x = r.x2; pt3.y = r.y1; ink.SetPoint(0, 10, pt3); //Top Path pt3.x = r.x1; pt3.y = r.y2; ink.SetPoint(1, 0, pt3); pt3.x = r.x1 + 10 * (r.x2 - r.x1) / 100; pt3.y = r.y2 - 7 * (r.y2 - r.y1) / 100; ink.SetPoint(1, 1, pt3); pt3.x = r.x1 + 20 * (r.x2 - r.x1) / 100; pt3.y = r.y2; ink.SetPoint(1, 2, pt3); pt3.x = r.x1 + 30 * (r.x2 - r.x1) / 100; pt3.y = r.y2 - 7 * (r.y2 - r.y1) / 100; ink.SetPoint(1, 3, pt3); pt3.x = r.x1 + 40 * (r.x2 - r.x1) / 100; pt3.y = r.y2; ink.SetPoint(1, 4, pt3); pt3.x = r.x1 + 50 * (r.x2 - r.x1) / 100; pt3.y = r.y2 - 7 * (r.y2 - r.y1) / 100; ink.SetPoint(1, 5, pt3); pt3.x = r.x1 + 60 * (r.x2 - r.x1) / 100; pt3.y = r.y2; ink.SetPoint(1, 6, pt3); pt3.x = r.x1 + 70 * (r.x2 - r.x1) / 100; pt3.y = r.y2 - 7 * (r.y2 - r.y1) / 100; ink.SetPoint(1, 7, pt3); pt3.x = r.x1 + 80 * (r.x2 - r.x1) / 100; pt3.y = r.y2; ink.SetPoint(1, 8, pt3); pt3.x = r.x1 + 90 * (r.x2 - r.x1) / 100; pt3.y = r.y2 - 7 * (r.y2 - r.y1) / 100; ink.SetPoint(1, 9, pt3); pt3.x = r.x2; pt3.y = r.y2; ink.SetPoint(1, 10, pt3); //Left Path pt3.x = r.x1; pt3.y = r.y1; ink.SetPoint(2, 0, pt3); pt3.y = r.y1 + 10 * (r.y2 - r.y1) / 100; pt3.x = r.x1 + 7 * (r.x2 - r.x1) / 100; ink.SetPoint(2, 1, pt3); pt3.y = r.y1 + 20 * (r.y2 - r.y1) / 100; pt3.x = r.x1; ink.SetPoint(2, 2, pt3); pt3.y = r.y1 + 30 * (r.y2 - r.y1) / 100; pt3.x = r.x1 + 7 * (r.x2 - r.x1) / 100; ink.SetPoint(2, 3, pt3); pt3.y = r.y1 + 40 * (r.y2 - r.y1) / 100; pt3.x = r.x1; ink.SetPoint(2, 4, pt3); pt3.y = r.y1 + 50 * (r.y2 - r.y1) / 100; pt3.x = r.x1 + 7 * (r.x2 - r.x1) / 100; ink.SetPoint(2, 5, pt3); pt3.y = r.y1 + 60 * (r.y2 - r.y1) / 100; pt3.x = r.x1; ink.SetPoint(2, 6, pt3); pt3.y = r.y1 + 70 * (r.y2 - r.y1) / 100; pt3.x = r.x1 + 7 * (r.x2 - r.x1) / 100; ink.SetPoint(2, 7, pt3); pt3.y = r.y1 + 80 * (r.y2 - r.y1) / 100; pt3.x = r.x1; ink.SetPoint(2, 8, pt3); pt3.y = r.y1 + 90 * (r.y2 - r.y1) / 100; pt3.x = r.x1 + 7 * (r.x2 - r.x1) / 100; ink.SetPoint(2, 9, pt3); pt3.x = r.x1; pt3.y = r.y2; ink.SetPoint(2, 10, pt3); //Right Path pt3.x = r.x2; pt3.y = r.y1; ink.SetPoint(3, 0, pt3); pt3.y = r.y1 + 10 * (r.y2 - r.y1) / 100; pt3.x = r.x2 - 7 * (r.x2 - r.x1) / 100; ink.SetPoint(3, 1, pt3); pt3.y = r.y1 + 20 * (r.y2 - r.y1) / 100; pt3.x = r.x2; ink.SetPoint(3, 2, pt3); pt3.y = r.y1 + 30 * (r.y2 - r.y1) / 100; pt3.x = r.x2 - 7 * (r.x2 - r.x1) / 100; ink.SetPoint(3, 3, pt3); pt3.y = r.y1 + 40 * (r.y2 - r.y1) / 100; pt3.x = r.x2; ink.SetPoint(3, 4, pt3); pt3.y = r.y1 + 50 * (r.y2 - r.y1) / 100; pt3.x = r.x2 - 7 * (r.x2 - r.x1) / 100; ink.SetPoint(3, 5, pt3); pt3.y = r.y1 + 60 * (r.y2 - r.y1) / 100; pt3.x = r.x2; ink.SetPoint(3, 6, pt3); pt3.y = r.y1 + 70 * (r.y2 - r.y1) / 100; pt3.x = r.x2 - 7 * (r.x2 - r.x1) / 100; ink.SetPoint(3, 7, pt3); pt3.y = r.y1 + 80 * (r.y2 - r.y1) / 100; pt3.x = r.x2; ink.SetPoint(3, 8, pt3); pt3.y = r.y1 + 90 * (r.y2 - r.y1) / 100; pt3.x = r.x2 - 7 * (r.x2 - r.x1) / 100; ink.SetPoint(3, 9, pt3); pt3.x = r.x2; pt3.y = r.y2; ink.SetPoint(3, 10, pt3); #endregion Path Calculations return(ink); }