|
@@ -15,14 +15,6 @@ using Compdfkit_Tools.Annotation.PDFAnnotationUI;
|
|
|
using Microsoft.Win32;
|
|
|
using System.Windows.Media;
|
|
|
using Compdfkit_Tools.Properties;
|
|
|
-using CPDFViewer = ComPDFKitViewer.PdfViewer.CPDFViewer;
|
|
|
-using ComPDFKit.Tool;
|
|
|
-using ComPDFKit.PDFAnnotation;
|
|
|
-using ComPDFKit.Import;
|
|
|
-using ComPDFKitViewer.Helper;
|
|
|
-using ComPDFKitViewer.Annot;
|
|
|
-using System.Windows.Input;
|
|
|
-using System.Linq;
|
|
|
|
|
|
namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
@@ -57,465 +49,13 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
private bool disableClean;
|
|
|
public event EventHandler ClearAnnotationBar;
|
|
|
|
|
|
- #region Rebuild
|
|
|
-
|
|
|
- private CPDFViewerTool cPDFViewerTool;
|
|
|
- CPDFAnnotation cPDFAnnotation;
|
|
|
- bool openCreateAnnot = false;
|
|
|
- bool selectedAnnot = false;
|
|
|
- CPDFAnnotationData pdfAnnotationData = null;
|
|
|
- C_ANNOTATION_TYPE CreateAnnotType = C_ANNOTATION_TYPE.C_ANNOTATION_UNKOWN;
|
|
|
- public void LoadPDFViewToolHandler()
|
|
|
- {
|
|
|
- cPDFViewerTool.SetViewerModel(ComPDFKit.Tool.MouseModess.kViewer);
|
|
|
- cPDFViewerTool.MouseLeftButtonDownHandler += CPDFViewerTool_MouseLeftButtonDownHandler;
|
|
|
- cPDFViewerTool.MouseLeftButtonUpHandler += CPDFViewerTool_MouseLeftButtonUpHandler;
|
|
|
- cPDFViewerTool.MouseMoveHandler += CPDFViewerTool_MouseMoveHandler;
|
|
|
- cPDFViewerTool.SelectedDataChanging += CPDFViewerTool_SelectedDataChanging;
|
|
|
- cPDFViewerTool.SelectedDataChanged += CPDFViewerTool_SelectedDataChanged;
|
|
|
- }
|
|
|
-
|
|
|
- private void CPDFViewerTool_SelectedDataChanged(object sender, ComPDFKit.Tool.DrawRect.SelectedRectData e)
|
|
|
- {
|
|
|
- if (e.annotData.AnnotType == C_ANNOTATION_TYPE.C_ANNOTATION_LINE)
|
|
|
- {
|
|
|
- CPDFLineAnnotation annotLine = (e.annotData.Annot as CPDFLineAnnotation);
|
|
|
- //annotLine.SetLinePoints(startPoint, endPoint);
|
|
|
- //annotLine.UpdateAp();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Rect rect1 = new Rect(
|
|
|
- (e.Square.Left - e.annotData.PaintOffset.X) / e.annotData.CurrentZoom,
|
|
|
- (e.Square.Top - e.annotData.PaintOffset.Y) / e.annotData.CurrentZoom,
|
|
|
- e.Square.Width / e.annotData.CurrentZoom,
|
|
|
- e.Square.Height / e.annotData.CurrentZoom
|
|
|
- );
|
|
|
- Rect rect = DpiHelper.StandardRectToPDFRect(rect1);
|
|
|
- CRect cRect = new CRect((float)rect.Left, (float)rect.Bottom, (float)rect.Right, (float)rect.Top);
|
|
|
- e.annotData.Annot.SetRect(cRect);
|
|
|
- }
|
|
|
- cPDFViewerTool.GetCPDFViewer().UpDataRenderFrame();
|
|
|
- }
|
|
|
-
|
|
|
- private void CPDFViewerTool_SelectedDataChanging(object sender, ComPDFKit.Tool.DrawRect.SelectedRectData e)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private void CPDFViewerTool_MouseMoveHandler(object sender, MouseHitTeseType e)
|
|
|
- {
|
|
|
- if (e == ComPDFKit.Tool.MouseHitTeseType.kSelectRect)
|
|
|
- {
|
|
|
- if (selectedAnnot)
|
|
|
- {
|
|
|
- cPDFViewerTool.DrawMoveSelectedRect();
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (!openCreateAnnot)
|
|
|
- {
|
|
|
- if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
|
|
|
- {
|
|
|
- cPDFViewerTool.SetAnnotIsProportionalScaling(true);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- cPDFViewerTool.SetAnnotIsProportionalScaling(false);
|
|
|
- }
|
|
|
- cPDFViewerTool.MoveDrawAnnot();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void CPDFViewerTool_MouseLeftButtonUpHandler(object sender, MouseHitTeseType e)
|
|
|
- {
|
|
|
- if (e == ComPDFKit.Tool.MouseHitTeseType.kSelectRect)
|
|
|
- {
|
|
|
- if (selectedAnnot)
|
|
|
- {
|
|
|
- cPDFViewerTool.DrawEndSelectedRect();
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (!openCreateAnnot)
|
|
|
- {
|
|
|
- Point StartPoint = cPDFViewerTool.GetStartPoint();
|
|
|
- Point EndPoint = cPDFViewerTool.GetEndPoint();
|
|
|
- List<Point> points = cPDFViewerTool.GetInkDrawPoints();
|
|
|
- Rect rect = cPDFViewerTool.EndDrawAnnot();
|
|
|
- if (cPDFAnnotation != null)
|
|
|
- {
|
|
|
- if (cPDFAnnotation.Type == C_ANNOTATION_TYPE.C_ANNOTATION_INK)
|
|
|
- {
|
|
|
- List<List<CPoint>> inkPathList = new List<List<CPoint>>();
|
|
|
- List<CPoint> inkPath = new List<CPoint>();
|
|
|
- float Left = -1;
|
|
|
- float Right = -1;
|
|
|
- float Top = -1;
|
|
|
- float Bottom = -1;
|
|
|
- foreach (Point inkNode in points)
|
|
|
- {
|
|
|
- inkPath.Add(new CPoint((float)DpiHelper.StandardNumToPDFNum(inkNode.X), (float)DpiHelper.StandardNumToPDFNum(inkNode.Y)));
|
|
|
-
|
|
|
- if (Left == -1)
|
|
|
- {
|
|
|
- Left = inkPath.Min(x => x.x);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Left = Math.Min(Left, inkPath.Min(x => x.x));
|
|
|
- }
|
|
|
- if (Right == -1)
|
|
|
- {
|
|
|
- Right = inkPath.Max(x => x.x);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Right = Math.Max(Right, inkPath.Max(x => x.x));
|
|
|
- }
|
|
|
- if (Top == -1)
|
|
|
- {
|
|
|
- Top = inkPath.Min(x => x.y);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Top = Math.Min(Top, inkPath.Min(x => x.y));
|
|
|
- }
|
|
|
- if (Bottom == -1)
|
|
|
- {
|
|
|
- Bottom = inkPath.Max(x => x.y);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Bottom = Math.Max(Bottom, inkPath.Max(x => x.y));
|
|
|
- }
|
|
|
- }
|
|
|
- inkPathList.Add(inkPath);
|
|
|
- (cPDFAnnotation as CPDFInkAnnotation).SetInkPath(inkPathList);
|
|
|
- (cPDFAnnotation as CPDFInkAnnotation).SetInkRect(new CRect(Left, Bottom, Right, Top));
|
|
|
- cPDFAnnotation.UpdateAp();
|
|
|
- cPDFViewerTool.ClearDrawAnnot();
|
|
|
- cPDFViewerTool.GetCPDFViewer().UpDataRenderFrame();
|
|
|
- cPDFAnnotation = null;
|
|
|
- return;
|
|
|
- }
|
|
|
- if (rect.Width <= 0 && rect.Width <= 0)
|
|
|
- {
|
|
|
- cPDFAnnotation.RemoveAnnot();
|
|
|
- cPDFAnnotation = null;
|
|
|
- return;
|
|
|
- }
|
|
|
- if (cPDFAnnotation.Type== C_ANNOTATION_TYPE.C_ANNOTATION_LINE)
|
|
|
- {
|
|
|
- (cPDFAnnotation as CPDFLineAnnotation).SetLinePoints(new CPoint((float)StartPoint.X, (float)StartPoint.Y), new CPoint((float)EndPoint.X, (float)EndPoint.Y));
|
|
|
- }
|
|
|
- CRect cRect = new CRect((float)rect.Left, (float)rect.Bottom, (float)rect.Right, (float)rect.Top);
|
|
|
- cPDFAnnotation.SetRect(cRect);
|
|
|
- cPDFAnnotation.UpdateAp();
|
|
|
- cPDFViewerTool.ClearDrawAnnot();
|
|
|
- cPDFViewerTool.GetCPDFViewer().UpDataRenderFrame();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void CPDFViewerTool_MouseLeftButtonDownHandler(object sender, MouseHitTeseType e)
|
|
|
- {
|
|
|
- if (e == ComPDFKit.Tool.MouseHitTeseType.kUnknown)
|
|
|
- {
|
|
|
- if (!openCreateAnnot)
|
|
|
- {
|
|
|
- if (CreateAnnotType!= C_ANNOTATION_TYPE.C_ANNOTATION_UNKOWN)
|
|
|
- {
|
|
|
- cPDFAnnotation = cPDFViewerTool.StartDrawAnnot(CreateAnnotType);
|
|
|
- if (cPDFAnnotation != null)
|
|
|
- {
|
|
|
- cPDFViewerTool.CleanSelectedRect();
|
|
|
- selectedAnnot = false;
|
|
|
- SetAnnotAttributes(cPDFAnnotation, pdfAnnotationData);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- cPDFViewerTool.CleanSelectedRect();
|
|
|
- selectedAnnot = false;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- cPDFViewerTool.DrawStartSelectedSaRect();
|
|
|
- selectedAnnot = true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public void SetAnnotAttributes(CPDFAnnotation cPDFAnnotation, CPDFAnnotationData data)
|
|
|
- {
|
|
|
- if (pdfAnnotationData==null)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- switch (cPDFAnnotation.Type)
|
|
|
- {
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_UNKOWN:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_TEXT:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_LINK:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_FREETEXT:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
|
|
|
- if (data.AnnotationType == CPDFAnnotationType.Line|| data.AnnotationType == CPDFAnnotationType.Arrow)
|
|
|
- {
|
|
|
- CPDFLineShapeData lineData = data as CPDFLineShapeData;
|
|
|
- CPDFLineAnnotation lineAnnot = cPDFAnnotation as CPDFLineAnnotation;
|
|
|
- lineAnnot.SetLineWidth(lineData.Thickness);
|
|
|
- byte[] lineColor = { lineData.BorderColor.R, lineData.BorderColor.G, lineData.BorderColor.B };
|
|
|
- lineAnnot.SetLineColor(lineColor);
|
|
|
- byte transparency = (byte)Math.Round(lineData.Opacity * 255);
|
|
|
- lineAnnot.SetTransparency(transparency);
|
|
|
-
|
|
|
- if (lineData.DashStyle != null)
|
|
|
- {
|
|
|
- if (lineData.DashStyle.Dashes.Count == 0)
|
|
|
- {
|
|
|
- lineAnnot.SetBorderStyle(C_BORDER_STYLE.BS_SOLID, new float[0]);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- List<float> floatArray = new List<float>();
|
|
|
- foreach (var num in lineData.DashStyle.Dashes)
|
|
|
- {
|
|
|
- floatArray.Add((float)num);
|
|
|
- }
|
|
|
- lineAnnot.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, floatArray.ToArray());
|
|
|
- }
|
|
|
- }
|
|
|
- lineAnnot.SetLineType(lineData.LineType.HeadLineType, lineData.LineType.TailLineType);
|
|
|
- lineAnnot.SetAuthor(lineData.Author);
|
|
|
- lineAnnot.SetContent(lineData.Note);
|
|
|
- lineAnnot.UpdateAp();
|
|
|
- }
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_SQUARE:
|
|
|
- if (data.AnnotationType == CPDFAnnotationType.Square)
|
|
|
- {
|
|
|
-
|
|
|
- CPDFShapeData squareData = data as CPDFShapeData;
|
|
|
- CPDFSquareAnnotation squareAnnot = cPDFAnnotation as CPDFSquareAnnotation;
|
|
|
- squareAnnot.SetLineWidth(squareData.Thickness);
|
|
|
- byte[] bgColor = { squareData.FillColor.R, squareData.FillColor.G, squareData.FillColor.B };
|
|
|
- if (squareData.FillColor != Colors.Transparent)
|
|
|
- {
|
|
|
- squareAnnot.SetBgColor(bgColor);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- squareAnnot.ClearBgColor();
|
|
|
- }
|
|
|
- byte[] lineColor = { squareData.BorderColor.R, squareData.BorderColor.G, squareData.BorderColor.B };
|
|
|
- squareAnnot.SetLineColor(lineColor);
|
|
|
- byte transparency = (byte)Math.Round(squareData.Opacity * 255);
|
|
|
- squareAnnot.SetTransparency(transparency);
|
|
|
-
|
|
|
- if (squareData.DashStyle != null)
|
|
|
- {
|
|
|
- if (squareData.DashStyle.Dashes.Count == 0)
|
|
|
- {
|
|
|
- squareAnnot.SetBorderStyle(C_BORDER_STYLE.BS_SOLID, new float[0]);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- List<float> floatArray = new List<float>();
|
|
|
- foreach (var num in squareData.DashStyle.Dashes)
|
|
|
- {
|
|
|
- floatArray.Add((float)num);
|
|
|
- }
|
|
|
- squareAnnot.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, floatArray.ToArray());
|
|
|
- }
|
|
|
- }
|
|
|
- squareAnnot.SetAuthor(squareData.Author);
|
|
|
- squareAnnot.SetContent(squareData.Note);
|
|
|
- squareAnnot.UpdateAp();
|
|
|
- }
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE:
|
|
|
- if (data.AnnotationType == CPDFAnnotationType.Circle)
|
|
|
- {
|
|
|
-
|
|
|
- CPDFShapeData circleData = data as CPDFShapeData;
|
|
|
- CPDFCircleAnnotation circleAnnot = cPDFAnnotation as CPDFCircleAnnotation;
|
|
|
- circleAnnot.SetLineWidth(circleData.Thickness);
|
|
|
- byte[] bgColor = { circleData.FillColor.R, circleData.FillColor.G, circleData.FillColor.B };
|
|
|
- if (circleData.FillColor!= Colors.Transparent)
|
|
|
- {
|
|
|
- circleAnnot.SetBgColor(bgColor);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- circleAnnot.ClearBgColor();
|
|
|
- }
|
|
|
- byte[] lineColor = { circleData.BorderColor.R, circleData.BorderColor.G, circleData.BorderColor.B };
|
|
|
- circleAnnot.SetLineColor(lineColor);
|
|
|
- byte transparency = (byte)Math.Round(circleData.Opacity * 255);
|
|
|
- circleAnnot.SetTransparency(transparency);
|
|
|
-
|
|
|
- if (circleData.DashStyle != null)
|
|
|
- {
|
|
|
- if (circleData.DashStyle.Dashes.Count == 0)
|
|
|
- {
|
|
|
- circleAnnot.SetBorderStyle(C_BORDER_STYLE.BS_SOLID, new float[0]);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- List<float> floatArray = new List<float>();
|
|
|
- foreach (var num in circleData.DashStyle.Dashes)
|
|
|
- {
|
|
|
- floatArray.Add((float)num);
|
|
|
- }
|
|
|
- circleAnnot.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, floatArray.ToArray());
|
|
|
- }
|
|
|
- }
|
|
|
- circleAnnot.SetAuthor(circleData.Author);
|
|
|
- circleAnnot.SetContent(circleData.Note);
|
|
|
- circleAnnot.UpdateAp();
|
|
|
- }
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_HIGHLIGHT:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_UNDERLINE:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_STRIKEOUT:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_STAMP:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_CARET:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_INK:
|
|
|
- if (data.AnnotationType == CPDFAnnotationType.Freehand)
|
|
|
- {
|
|
|
- CPDFFreehandData inkData = data as CPDFFreehandData;
|
|
|
- CPDFInkAnnotation inkAnnot = cPDFAnnotation as CPDFInkAnnotation;
|
|
|
- inkAnnot.SetThickness((float)inkData.Thickness);
|
|
|
- byte[] lineColor = { inkData.BorderColor.R, inkData.BorderColor.G, inkData.BorderColor.B };
|
|
|
- inkAnnot.SetInkColor(lineColor);
|
|
|
- byte transparency = (byte)Math.Round(inkData.Opacity * 255);
|
|
|
- inkAnnot.SetTransparency(transparency);
|
|
|
-
|
|
|
- inkAnnot.SetAuthor(inkData.Author);
|
|
|
- inkAnnot.SetContent(inkData.Note);
|
|
|
- }
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_POPUP:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_FILEATTACHMENT:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_SOUND:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_MOVIE:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_SCREEN:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_PRINTERMARK:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_TRAPNET:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_WATERMARK:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_3D:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_RICHMEDIA:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_REDACT:
|
|
|
- break;
|
|
|
- case C_ANNOTATION_TYPE.C_ANNOTATION_INTERCHANGE:
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public void SetCreateAnnot(CPDFAnnotationData data)
|
|
|
- {
|
|
|
- CPDFAnnotationType annotationType = data.AnnotationType;
|
|
|
- pdfAnnotationData = data;
|
|
|
- switch (annotationType)
|
|
|
- {
|
|
|
- case CPDFAnnotationType.Unknow:
|
|
|
- cPDFViewerTool.SetViewerModel(ComPDFKit.Tool.MouseModess.kViewer);
|
|
|
- return;
|
|
|
- case CPDFAnnotationType.Highlight:
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Underline:
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Strikeout:
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Squiggly:
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.FreeText:
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Freehand:
|
|
|
- CreateAnnotType = C_ANNOTATION_TYPE.C_ANNOTATION_INK;
|
|
|
- cPDFViewerTool.SetViewerModel(ComPDFKit.Tool.MouseModess.kCreateAnnot);
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Note:
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Circle:
|
|
|
- CreateAnnotType = C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE;
|
|
|
- cPDFViewerTool.SetViewerModel(ComPDFKit.Tool.MouseModess.kCreateAnnot);
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Square:
|
|
|
- CreateAnnotType = C_ANNOTATION_TYPE.C_ANNOTATION_SQUARE;
|
|
|
- cPDFViewerTool.SetViewerModel(ComPDFKit.Tool.MouseModess.kCreateAnnot);
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Arrow:
|
|
|
- case CPDFAnnotationType.Line:
|
|
|
- CreateAnnotType = C_ANNOTATION_TYPE.C_ANNOTATION_LINE;
|
|
|
- cPDFViewerTool.SetViewerModel(ComPDFKit.Tool.MouseModess.kCreateAnnot);
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Stamp:
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Signature:
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Link:
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Audio:
|
|
|
- break;
|
|
|
- case CPDFAnnotationType.Image:
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
public CPDFAnnotationControl()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public void SetPDFViewer(CPDFViewer pdfViewer, CPDFViewerTool tool)
|
|
|
+ public void SetPDFViewer(CPDFViewer pdfViewer)
|
|
|
{
|
|
|
- cPDFViewerTool = tool;
|
|
|
- if (cPDFViewerTool != null)
|
|
|
- {
|
|
|
- LoadPDFViewToolHandler();
|
|
|
- }
|
|
|
if (this.pdfViewer != null)
|
|
|
{
|
|
|
UnLoadPDFViewHandler();
|
|
@@ -524,7 +64,6 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
LoadPDFViewHandler();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public void LoadPDFViewHandler()
|
|
|
{
|
|
|
if (this.pdfViewer != null)
|
|
@@ -664,8 +203,6 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- SetCreateAnnot(pdfAnnotationData);
|
|
|
-
|
|
|
CPDFAnnotationType annotationType = pdfAnnotationData.AnnotationType;
|
|
|
AnnotHandlerEventArgs annotHandlerEventArgs = null;
|
|
|
Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
|