Browse Source

【2025】【PDFView】高亮注释设置初始默认值

dinglingui 3 weeks ago
parent
commit
da14dbc6bd

+ 19 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/ComPDFUIConfig.swift

@@ -25,6 +25,25 @@ class ComPDFUIConfig: NSObject {
             CPDFKitConfig.sharedInstance().isShowFormRequiredFlagColor = false
             
             CPDFListViewConfig.defaultManager.isSaveDefault = true
+            let sud = UserDefaults.standard
+
+            if sud.object(forKey: CHighlightNoteColorKey) == nil {
+                
+                CPDFAnnotationConfig.standard.setColor(CPDFMarkupAnnotation.defaultColor(.highlight), toType: .highlight)
+            }
+            
+            if sud.object(forKey: CStrikeOutNoteColorKey) == nil {
+                CPDFAnnotationConfig.standard.setColor(CPDFMarkupAnnotation.defaultColor(.strikeOut), toType: .strikeOut)
+            }
+            
+            if sud.object(forKey: CUnderlineNoteColorKey) == nil {
+                CPDFAnnotationConfig.standard.setColor(CPDFMarkupAnnotation.defaultColor(.underline), toType: .underline)
+            }
+            
+            if sud.object(forKey: CSquigglyNoteColorKey) == nil {
+                CPDFAnnotationConfig.standard.setColor(CPDFMarkupAnnotation.defaultColor(.squiggly), toType: .squiggly)
+            }
+
         }
     }
 }