Преглед на файлове

ComPDFKit(win) - 兼容文字编辑接口

TangJinZhou преди 8 месеца
родител
ревизия
45765b1707
променени са 1 файла, в които са добавени 8 реда и са изтрити 13 реда
  1. 8 13
      Demo/Examples/ComPDFKit.Tool/Help/ParamConverter.cs

+ 8 - 13
Demo/Examples/ComPDFKit.Tool/Help/ParamConverter.cs

@@ -9,19 +9,12 @@ using ComPDFKit.PDFPage.Edit;
 using ComPDFKit.Tool.SettingParam;
 using ComPDFKit.Tool.UndoManger;
 using ComPDFKit.Viewer.Helper;
-using ComPDFKitViewer.Annot;
-using ComPDFKitViewer.BaseObject;
-using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using System.Windows;
-using System.Windows.Documents;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
-using System.Xml.Linq;
 using static ComPDFKit.PDFAnnotation.CTextAttribute;
 using static ComPDFKit.PDFAnnotation.CTextAttribute.CFontNameHelper;
 
@@ -347,18 +340,20 @@ namespace ComPDFKit.Tool.Help
         internal static TextEditParam GetTextEditParam(CPDFDocument cPDFDocument, CPDFEditTextArea cPDFEditArea, int PageIndex)
         {
             TextEditParam textEditParam = new TextEditParam();
-            float fontSize = 0;
-            byte[] fontColor = null;
-            byte transparency = 0;
+            string fontName = "Helvetica";
+            float fontSize = 14;
+            byte[] fontColor = {0,0,0};
+            byte transparency = 255;
             bool isBold = false;
             bool isItalic = false;
-            cPDFEditArea.GetTextStyle(ref fontSize, ref fontColor, ref transparency, ref isBold, ref isItalic);
-            textEditParam.Transparency = transparency;
+
+            cPDFEditArea.GetTextStyle(ref fontName, ref fontSize, ref fontColor, ref transparency, ref isBold, ref isItalic);
+            textEditParam.FontName = fontName;
             textEditParam.FontSize = fontSize;
             textEditParam.FontColor = fontColor;
+            textEditParam.Transparency = transparency;
             textEditParam.TextAlign = cPDFEditArea.GetTextSectionAlign();
             textEditParam.EditType = CPDFEditType.EditText;
-            textEditParam.FontName = cPDFEditArea.GetCharsFontName();
             CPDFPage docPage = cPDFDocument.PageAtIndex(PageIndex);
             CPDFEditPage EditPage = docPage.GetEditPage();
             textEditParam.EditIndex = EditPage.GetEditAreaList().IndexOf(cPDFEditArea);