|
@@ -2,8 +2,10 @@
|
|
using ComPDFKit.PDFPage;
|
|
using ComPDFKit.PDFPage;
|
|
using ComPDFKit.PDFPage.Edit;
|
|
using ComPDFKit.PDFPage.Edit;
|
|
using ComPDFKit.Tool;
|
|
using ComPDFKit.Tool;
|
|
|
|
+using ComPDFKit.Tool.SettingParam;
|
|
using ComPDFKit.Tool.UndoManger;
|
|
using ComPDFKit.Tool.UndoManger;
|
|
using ComPDFKit.Viewer.Helper;
|
|
using ComPDFKit.Viewer.Helper;
|
|
|
|
+using Compdfkit_Tools.PDFControl;
|
|
using ComPDFKitViewer;
|
|
using ComPDFKitViewer;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
@@ -37,7 +39,7 @@ namespace Compdfkit_Tools.Edit
|
|
List<string> sysfontList = new List<string>();
|
|
List<string> sysfontList = new List<string>();
|
|
if (textArea != null)
|
|
if (textArea != null)
|
|
{
|
|
{
|
|
- sysfontList= textArea.GetFontList();
|
|
|
|
|
|
+ sysfontList = textArea.GetFontList();
|
|
}
|
|
}
|
|
if (sysfontList.Count == 0)
|
|
if (sysfontList.Count == 0)
|
|
{
|
|
{
|
|
@@ -57,14 +59,14 @@ namespace Compdfkit_Tools.Edit
|
|
OpacityTextBox.Text = string.Format("{0}%", (int)(Math.Ceiling(newEvent.Transparency * 100 / 255D)));
|
|
OpacityTextBox.Text = string.Format("{0}%", (int)(Math.Ceiling(newEvent.Transparency * 100 / 255D)));
|
|
FontOpacitySlider.Value = ((int)(Math.Ceiling(newEvent.Transparency * 100 / 255D))) / 100D;
|
|
FontOpacitySlider.Value = ((int)(Math.Ceiling(newEvent.Transparency * 100 / 255D))) / 100D;
|
|
TextAlignUI.SetFontAlign(newEvent.TextAlign);
|
|
TextAlignUI.SetFontAlign(newEvent.TextAlign);
|
|
- if(newEvent.FontColor != null && newEvent.FontColor.Length==3)
|
|
|
|
|
|
+ if (newEvent.FontColor != null && newEvent.FontColor.Length == 3)
|
|
{
|
|
{
|
|
FontColorUI.SetCheckedForColor(Color.FromRgb(
|
|
FontColorUI.SetCheckedForColor(Color.FromRgb(
|
|
newEvent.FontColor[0],
|
|
newEvent.FontColor[0],
|
|
newEvent.FontColor[1],
|
|
newEvent.FontColor[1],
|
|
newEvent.FontColor[2]));
|
|
newEvent.FontColor[2]));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
EditEvent = newEvent;
|
|
EditEvent = newEvent;
|
|
}
|
|
}
|
|
@@ -79,8 +81,8 @@ namespace Compdfkit_Tools.Edit
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
if (textArea != null)
|
|
if (textArea != null)
|
|
{
|
|
{
|
|
- Rect oldRect= DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
- if (textArea.SetCharsFontSize((float)slider.Value,false))
|
|
|
|
|
|
+ Rect oldRect = DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
+ if (textArea.SetCharsFontSize((float)slider.Value, false))
|
|
{
|
|
{
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
editHistory.EditPage = editPage;
|
|
editHistory.EditPage = editPage;
|
|
@@ -91,8 +93,15 @@ namespace Compdfkit_Tools.Edit
|
|
|
|
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
|
|
+ editPage.EndEdit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (EditEvent != null && textArea == null)
|
|
|
|
+ {
|
|
|
|
+ EditEvent.FontSize = slider.Value;
|
|
|
|
+ DefaultSettingParam defaultSettingParam = ToolView.GetDefaultSettingParam();
|
|
|
|
+ defaultSettingParam.SetPDFEditParamm(EditEvent);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void SliderOpacity_DragCompleted(object sender, DragCompletedEventArgs e)
|
|
private void SliderOpacity_DragCompleted(object sender, DragCompletedEventArgs e)
|
|
@@ -105,8 +114,8 @@ namespace Compdfkit_Tools.Edit
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
if (textArea != null)
|
|
if (textArea != null)
|
|
{
|
|
{
|
|
- Rect oldRect= DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
- if(textArea.SetCharsFontTransparency((byte)(FontOpacitySlider.Value * 255)))
|
|
|
|
|
|
+ Rect oldRect = DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
+ if (textArea.SetCharsFontTransparency((byte)(FontOpacitySlider.Value * 255)))
|
|
{
|
|
{
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
editHistory.EditPage = editPage;
|
|
editHistory.EditPage = editPage;
|
|
@@ -116,8 +125,15 @@ namespace Compdfkit_Tools.Edit
|
|
}
|
|
}
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
|
|
+ editPage.EndEdit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (EditEvent != null && textArea == null)
|
|
|
|
+ {
|
|
|
|
+ EditEvent.Transparency = (byte)(FontOpacitySlider.Value * 255);
|
|
|
|
+ DefaultSettingParam defaultSettingParam = ToolView.GetDefaultSettingParam();
|
|
|
|
+ defaultSettingParam.SetPDFEditParamm(EditEvent);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void SliderOpacity_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
|
private void SliderOpacity_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
|
@@ -135,7 +151,7 @@ namespace Compdfkit_Tools.Edit
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
if (textArea != null)
|
|
if (textArea != null)
|
|
{
|
|
{
|
|
- Rect oldRect=DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
|
|
+ Rect oldRect = DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
if (textArea.SetCharsFontTransparency((byte)(FontOpacitySlider.Value * 255)))
|
|
if (textArea.SetCharsFontTransparency((byte)(FontOpacitySlider.Value * 255)))
|
|
{
|
|
{
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
@@ -146,8 +162,15 @@ namespace Compdfkit_Tools.Edit
|
|
}
|
|
}
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
|
|
+ editPage.EndEdit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (EditEvent != null && textArea == null)
|
|
|
|
+ {
|
|
|
|
+ EditEvent.Transparency = (byte)(FontOpacitySlider.Value * 255);
|
|
|
|
+ DefaultSettingParam defaultSettingParam = ToolView.GetDefaultSettingParam();
|
|
|
|
+ defaultSettingParam.SetPDFEditParamm(EditEvent);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void Slider_DragStarted(object sender, DragStartedEventArgs e)
|
|
private void Slider_DragStarted(object sender, DragStartedEventArgs e)
|
|
@@ -170,8 +193,8 @@ namespace Compdfkit_Tools.Edit
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
if (textArea != null)
|
|
if (textArea != null)
|
|
{
|
|
{
|
|
- Rect oldRect=DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
- if (textArea.SetCharsFontSize((float)slider.Value,false))
|
|
|
|
|
|
+ Rect oldRect = DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
+ if (textArea.SetCharsFontSize((float)slider.Value, false))
|
|
{
|
|
{
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
editHistory.EditPage = editPage;
|
|
editHistory.EditPage = editPage;
|
|
@@ -181,8 +204,15 @@ namespace Compdfkit_Tools.Edit
|
|
}
|
|
}
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
|
|
+ editPage.EndEdit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (EditEvent != null && textArea == null)
|
|
|
|
+ {
|
|
|
|
+ EditEvent.FontSize = slider.Value;
|
|
|
|
+ DefaultSettingParam defaultSettingParam = ToolView.GetDefaultSettingParam();
|
|
|
|
+ defaultSettingParam.SetPDFEditParamm(EditEvent);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void PDFTextEditControl_Loaded(object sender, RoutedEventArgs e)
|
|
private void PDFTextEditControl_Loaded(object sender, RoutedEventArgs e)
|
|
@@ -208,7 +238,7 @@ namespace Compdfkit_Tools.Edit
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
if (textArea != null)
|
|
if (textArea != null)
|
|
{
|
|
{
|
|
- Rect oldRect=DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
|
|
+ Rect oldRect = DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
if (textArea.SetCharsFontSize((float)e, false))
|
|
if (textArea.SetCharsFontSize((float)e, false))
|
|
{
|
|
{
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
@@ -219,17 +249,24 @@ namespace Compdfkit_Tools.Edit
|
|
}
|
|
}
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
|
|
+ editPage.EndEdit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (EditEvent != null && textArea == null)
|
|
|
|
+ {
|
|
|
|
+ EditEvent.FontSize = e;
|
|
|
|
+ DefaultSettingParam defaultSettingParam = ToolView.GetDefaultSettingParam();
|
|
|
|
+ defaultSettingParam.SetPDFEditParamm(EditEvent);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void FontColorUI_ColorChanged(object sender, EventArgs e)
|
|
private void FontColorUI_ColorChanged(object sender, EventArgs e)
|
|
{
|
|
{
|
|
SolidColorBrush newBrush = FontColorUI.Brush as SolidColorBrush;
|
|
SolidColorBrush newBrush = FontColorUI.Brush as SolidColorBrush;
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
- if (textArea != null && newBrush!=null)
|
|
|
|
|
|
+ if (textArea != null && newBrush != null)
|
|
{
|
|
{
|
|
- Rect oldRect= DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
|
|
+ Rect oldRect = DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
if (textArea.SetCharsFontColor(newBrush.Color.R, newBrush.Color.G, newBrush.Color.B))
|
|
if (textArea.SetCharsFontColor(newBrush.Color.R, newBrush.Color.G, newBrush.Color.B))
|
|
{
|
|
{
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
@@ -240,8 +277,19 @@ namespace Compdfkit_Tools.Edit
|
|
}
|
|
}
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
|
|
+ editPage.EndEdit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (EditEvent != null && textArea == null && newBrush != null)
|
|
|
|
+ {
|
|
|
|
+ byte[] Color = new byte[3];
|
|
|
|
+ Color[0] = newBrush.Color.R;
|
|
|
|
+ Color[1] = newBrush.Color.G;
|
|
|
|
+ Color[2] = newBrush.Color.B;
|
|
|
|
+ EditEvent.FontColor = Color;
|
|
|
|
+ DefaultSettingParam defaultSettingParam = ToolView.GetDefaultSettingParam();
|
|
|
|
+ defaultSettingParam.SetPDFEditParamm(EditEvent);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void TextAlignUI_TextAlignChanged(object sender, TextAlignType e)
|
|
private void TextAlignUI_TextAlignChanged(object sender, TextAlignType e)
|
|
@@ -250,14 +298,14 @@ namespace Compdfkit_Tools.Edit
|
|
if (textArea != null)
|
|
if (textArea != null)
|
|
{
|
|
{
|
|
bool result = false;
|
|
bool result = false;
|
|
- Rect oldRect= DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
- if(textArea.SelectLineRects!=null && textArea.SelectLineRects.Count>0)
|
|
|
|
|
|
+ Rect oldRect = DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
+ if (textArea.SelectLineRects != null && textArea.SelectLineRects.Count > 0)
|
|
{
|
|
{
|
|
result = textArea.SetTextRangeAlign(e);
|
|
result = textArea.SetTextRangeAlign(e);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- result= textArea.SetTextAreaAlign(e);
|
|
|
|
|
|
+ result = textArea.SetTextAreaAlign(e);
|
|
}
|
|
}
|
|
if (result)
|
|
if (result)
|
|
{
|
|
{
|
|
@@ -269,8 +317,16 @@ namespace Compdfkit_Tools.Edit
|
|
}
|
|
}
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
|
|
+ editPage.EndEdit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (EditEvent != null && textArea == null)
|
|
|
|
+ {
|
|
|
|
+ EditEvent.TextAlign = e;
|
|
|
|
+ DefaultSettingParam defaultSettingParam = ToolView.GetDefaultSettingParam();
|
|
|
|
+ defaultSettingParam.SetPDFEditParamm(EditEvent);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void TextStyleUI_TextItalicChanged(object sender, bool e)
|
|
private void TextStyleUI_TextItalicChanged(object sender, bool e)
|
|
@@ -278,8 +334,8 @@ namespace Compdfkit_Tools.Edit
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
if (textArea != null)
|
|
if (textArea != null)
|
|
{
|
|
{
|
|
- Rect oldRect= DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
- if(textArea.SetCharsFontItalic(e))
|
|
|
|
|
|
+ Rect oldRect = DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
+ if (textArea.SetCharsFontItalic(e))
|
|
{
|
|
{
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
editHistory.EditPage = editPage;
|
|
editHistory.EditPage = editPage;
|
|
@@ -289,8 +345,15 @@ namespace Compdfkit_Tools.Edit
|
|
}
|
|
}
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
|
|
+ editPage.EndEdit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (EditEvent != null && textArea == null)
|
|
|
|
+ {
|
|
|
|
+ EditEvent.IsItalic = e;
|
|
|
|
+ DefaultSettingParam defaultSettingParam = ToolView.GetDefaultSettingParam();
|
|
|
|
+ defaultSettingParam.SetPDFEditParamm(EditEvent);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void TextStyleUI_TextBoldChanged(object sender, bool e)
|
|
private void TextStyleUI_TextBoldChanged(object sender, bool e)
|
|
@@ -298,7 +361,7 @@ namespace Compdfkit_Tools.Edit
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
if (textArea != null)
|
|
if (textArea != null)
|
|
{
|
|
{
|
|
- Rect oldRect= DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
|
|
+ Rect oldRect = DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
if (textArea.SetCharsFontBold(e))
|
|
if (textArea.SetCharsFontBold(e))
|
|
{
|
|
{
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
@@ -309,8 +372,15 @@ namespace Compdfkit_Tools.Edit
|
|
}
|
|
}
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
|
|
+ editPage.EndEdit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (EditEvent != null && textArea == null)
|
|
|
|
+ {
|
|
|
|
+ EditEvent.IsBold = e;
|
|
|
|
+ DefaultSettingParam defaultSettingParam = ToolView.GetDefaultSettingParam();
|
|
|
|
+ defaultSettingParam.SetPDFEditParamm(EditEvent);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void TextStyleUI_TextFontChanged(object sender, string e)
|
|
private void TextStyleUI_TextFontChanged(object sender, string e)
|
|
@@ -318,7 +388,7 @@ namespace Compdfkit_Tools.Edit
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
GetTextArea(out CPDFEditTextArea textArea, out CPDFPage pdfPage, out CPDFEditPage editPage);
|
|
if (textArea != null)
|
|
if (textArea != null)
|
|
{
|
|
{
|
|
- Rect oldRect= DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
|
|
|
|
+ Rect oldRect = DataConversionForWPF.CRectConversionForRect(textArea.GetFrame());
|
|
if (textArea.SetCharsFontName(e))
|
|
if (textArea.SetCharsFontName(e))
|
|
{
|
|
{
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
@@ -329,8 +399,15 @@ namespace Compdfkit_Tools.Edit
|
|
}
|
|
}
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.GetCPDFViewer()?.UndoManager.AddHistory(editHistory);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
ToolView.UpDateRender(oldRect, textArea);
|
|
|
|
+ editPage.EndEdit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (EditEvent != null && textArea == null)
|
|
|
|
+ {
|
|
|
|
+ EditEvent.FontName = e;
|
|
|
|
+ DefaultSettingParam defaultSettingParam = ToolView.GetDefaultSettingParam();
|
|
|
|
+ defaultSettingParam.SetPDFEditParamm(EditEvent);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void OpacityComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
private void OpacityComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
@@ -351,26 +428,37 @@ namespace Compdfkit_Tools.Edit
|
|
textArea = null;
|
|
textArea = null;
|
|
editPage = null;
|
|
editPage = null;
|
|
pdfPage = null;
|
|
pdfPage = null;
|
|
- if (ToolView == null || EditEvent == null)
|
|
|
|
|
|
+ if (ToolView == null)
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
- try
|
|
|
|
|
|
+ if (EditEvent != null)
|
|
{
|
|
{
|
|
- CPDFViewer pdfViewer = ToolView.GetCPDFViewer();
|
|
|
|
- CPDFDocument pdfDoc = pdfViewer.GetDocument();
|
|
|
|
- pdfPage = pdfDoc.PageAtIndex(EditEvent.PageIndex);
|
|
|
|
- editPage = pdfPage.GetEditPage();
|
|
|
|
- List<CPDFEditArea> editAreas = editPage.GetEditAreaList();
|
|
|
|
- if (editAreas != null && editAreas.Count > EditEvent.EditIndex)
|
|
|
|
|
|
+ try
|
|
{
|
|
{
|
|
- textArea = editAreas[EditEvent.EditIndex] as CPDFEditTextArea;
|
|
|
|
|
|
+ CPDFViewer pdfViewer = ToolView.GetCPDFViewer();
|
|
|
|
+ CPDFDocument pdfDoc = pdfViewer.GetDocument();
|
|
|
|
+ pdfPage = pdfDoc.PageAtIndex(EditEvent.PageIndex);
|
|
|
|
+ editPage = pdfPage.GetEditPage();
|
|
|
|
+ List<CPDFEditArea> editAreas = editPage.GetEditAreaList();
|
|
|
|
+ if (editAreas != null && editAreas.Count > EditEvent.EditIndex)
|
|
|
|
+ {
|
|
|
|
+ textArea = editAreas[EditEvent.EditIndex] as CPDFEditTextArea;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- catch (Exception ex)
|
|
|
|
|
|
+ else
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ CPDFViewer pdfViewer = ToolView.GetCPDFViewer();
|
|
|
|
+ CPDFDocument pdfDoc = pdfViewer.GetDocument();
|
|
|
|
+ pdfPage = pdfDoc.PageAtIndex(0);
|
|
|
|
+ editPage = pdfPage.GetEditPage();
|
|
|
|
+ editPage.BeginEdit(CPDFEditType.EditText);
|
|
|
|
+ editPage.EndEdit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|