Explorar el Código

【EditPDF】内容编辑悬浮窗口UI补充

tangchao hace 8 meses
padre
commit
09f8c21699
Se han modificado 16 ficheros con 867 adiciones y 2 borrados
  1. 21 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFAlignJustifiedX.imageset/Contents.json
  2. 83 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFAlignJustifiedX.imageset/Icon.pdf
  3. 21 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFAlignJustifiedY.imageset/Contents.json
  4. 83 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFAlignJustifiedY.imageset/Icon.pdf
  5. 21 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFCrop.imageset/Contents.json
  6. 102 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFCrop.imageset/Icon.pdf
  7. 21 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFExport.imageset/Contents.json
  8. 96 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFExport.imageset/Icon.pdf
  9. 21 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReplace.imageset/Contents.json
  10. BIN
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReplace.imageset/Icon.pdf
  11. 21 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReverseX.imageset/Contents.json
  12. 171 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReverseX.imageset/Icon.pdf
  13. 21 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReverseY.imageset/Contents.json
  14. 86 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReverseY.imageset/Icon.pdf
  15. 57 1
      PDF Office/PDF Master/Class/PDFTools/EditPDF/Controller/KMEditPDFPopToolBarController.swift
  16. 42 1
      PDF Office/PDF Master/Class/PDFTools/EditPDF/Tools/KMEditPDfHanddler.swift

+ 21 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFAlignJustifiedX.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "Icon.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 83 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFAlignJustifiedX.imageset/Icon.pdf

@@ -0,0 +1,83 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 10.000000 9.000000 cm
+0.056471 0.065882 0.080000 scn
+0.000000 0.000000 m
+0.000000 14.000000 l
+1.500000 14.000000 l
+1.500000 0.000000 l
+0.000000 0.000000 l
+h
+4.500000 11.000000 m
+7.500000 11.000000 l
+7.500000 3.000000 l
+4.500000 3.000000 l
+4.500000 11.000000 l
+h
+10.500000 14.000000 m
+10.500000 0.000000 l
+12.000000 0.000000 l
+12.000000 14.000000 l
+10.500000 14.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  446
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 32.000000 32.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000536 00000 n
+0000000558 00000 n
+0000000731 00000 n
+0000000805 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+864
+%%EOF

+ 21 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFAlignJustifiedY.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "Icon.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 83 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFAlignJustifiedY.imageset/Icon.pdf

@@ -0,0 +1,83 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+-1.000000 0.000000 -0.000000 -1.000000 23.000002 22.000000 cm
+0.056471 0.065882 0.080000 scn
+0.000000 10.499999 m
+14.000000 10.500000 l
+14.000000 12.000000 l
+0.000000 12.000000 l
+0.000000 10.499999 l
+h
+3.000000 7.499999 m
+11.000000 7.499999 l
+11.000000 4.500000 l
+3.000000 4.500000 l
+3.000000 7.499999 l
+h
+14.000001 0.000000 m
+0.000000 -0.000001 l
+0.000000 1.499999 l
+14.000001 1.500000 l
+14.000001 0.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  449
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 32.000000 32.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000539 00000 n
+0000000561 00000 n
+0000000734 00000 n
+0000000808 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+867
+%%EOF

+ 21 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFCrop.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "Icon.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 102 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFCrop.imageset/Icon.pdf

@@ -0,0 +1,102 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 8.500000 8.500000 cm
+0.056471 0.065882 0.080000 scn
+2.642857 3.273844 m
+2.642857 12.357143 l
+6.428598 12.357143 l
+9.642898 12.357143 l
+11.250048 12.357143 l
+11.250048 13.357143 l
+9.642898 13.357143 l
+6.428598 13.357143 l
+2.642857 13.357143 l
+2.642857 15.000000 l
+1.642857 15.000000 l
+1.642857 13.357143 l
+0.000000 13.357143 l
+0.000000 12.357143 l
+1.642857 12.357143 l
+1.642857 2.142805 l
+1.642857 1.642805 l
+2.142857 1.642805 l
+12.357197 1.642805 l
+12.357197 -0.000051 l
+13.357197 -0.000051 l
+13.357197 1.642805 l
+15.000053 1.642805 l
+15.000053 2.642805 l
+13.357197 2.642805 l
+13.357197 6.428545 l
+13.357197 9.642844 l
+13.357197 11.249993 l
+12.357197 11.249993 l
+12.357197 9.642844 l
+12.357197 6.428545 l
+12.357197 2.642805 l
+3.426032 2.642805 l
+14.357984 13.574757 l
+13.650876 14.281863 l
+2.642857 3.273844 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  886
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 32.000000 32.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000976 00000 n
+0000000998 00000 n
+0000001171 00000 n
+0000001245 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1304
+%%EOF

+ 21 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFExport.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "Icon.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 96 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFExport.imageset/Icon.pdf

@@ -0,0 +1,96 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 10.462524 10.749023 cm
+0.056471 0.065882 0.080000 scn
+0.500000 11.788086 m
+0.000000 11.788086 l
+0.000000 11.288086 l
+0.000000 0.500488 l
+0.000000 0.000488 l
+0.500000 0.000488 l
+5.537475 0.000488 l
+5.537475 1.000488 l
+1.000000 1.000488 l
+1.000000 10.788086 l
+11.537476 10.788086 l
+11.537476 7.500488 l
+12.537476 7.500488 l
+12.537476 11.288086 l
+12.537476 11.788086 l
+12.037476 11.788086 l
+0.500000 11.788086 l
+h
+10.313430 5.473067 m
+11.868637 3.917861 l
+4.537465 3.917857 l
+4.537465 2.917857 l
+11.930133 2.917861 l
+10.313430 1.301157 l
+11.020536 0.594050 l
+13.460045 3.033560 l
+13.813599 3.387114 l
+13.460045 3.740667 l
+11.020536 6.180174 l
+10.313430 5.473067 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  737
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 32.000000 32.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000827 00000 n
+0000000849 00000 n
+0000001022 00000 n
+0000001096 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1155
+%%EOF

+ 21 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReplace.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "Icon.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReplace.imageset/Icon.pdf


+ 21 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReverseX.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "Icon.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 171 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReverseX.imageset/Icon.pdf

@@ -0,0 +1,171 @@
+%PDF-1.7
+
+1 0 obj
+  << /Type /XObject
+     /Length 2 0 R
+     /Group << /Type /Group
+               /S /Transparency
+            >>
+     /Subtype /Form
+     /Resources << >>
+     /BBox [ 0.000000 0.000000 32.000000 32.000000 ]
+  >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 -6.000000 0.000000 cm
+0.929412 0.933333 0.941176 scn
+0.000000 32.000000 m
+44.000000 32.000000 l
+44.000000 0.000000 l
+0.000000 0.000000 l
+0.000000 32.000000 l
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 8.000000 9.500000 cm
+0.105882 0.105882 0.105882 scn
+7.529412 0.000050 m
+0.000000 0.000050 l
+7.529412 13.000000 l
+7.529412 0.000050 l
+h
+9.470588 1.000050 m
+14.265192 1.000050 l
+9.470588 9.278200 l
+9.470588 1.000050 l
+h
+16.000000 0.000050 m
+14.844379 0.000050 l
+9.470588 0.000050 l
+8.470588 0.000050 l
+8.470588 1.000050 l
+8.470588 11.004756 l
+8.470588 13.000000 l
+9.470588 11.273444 l
+15.420813 1.000050 l
+16.000000 0.000050 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+2 0 obj
+  706
+endobj
+
+3 0 obj
+  << /Type /XObject
+     /Length 4 0 R
+     /Group << /Type /Group
+               /S /Transparency
+            >>
+     /Subtype /Form
+     /Resources << >>
+     /BBox [ 0.000000 0.000000 32.000000 32.000000 ]
+  >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
+0.000000 0.000000 0.000000 scn
+0.000000 28.000000 m
+0.000000 30.209139 1.790861 32.000000 4.000000 32.000000 c
+28.000000 32.000000 l
+30.209139 32.000000 32.000000 30.209139 32.000000 28.000000 c
+32.000000 4.000000 l
+32.000000 1.790861 30.209139 0.000000 28.000000 0.000000 c
+4.000000 0.000000 l
+1.790861 0.000000 0.000000 1.790861 0.000000 4.000000 c
+0.000000 28.000000 l
+h
+f
+n
+Q
+
+endstream
+endobj
+
+4 0 obj
+  468
+endobj
+
+5 0 obj
+  << /XObject << /X1 1 0 R >>
+     /ExtGState << /E1 << /SMask << /Type /Mask
+                                    /G 3 0 R
+                                    /S /Alpha
+                                 >>
+                          /Type /ExtGState
+                       >> >>
+  >>
+endobj
+
+6 0 obj
+  << /Length 7 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+/E1 gs
+/X1 Do
+Q
+
+endstream
+endobj
+
+7 0 obj
+  46
+endobj
+
+8 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 32.000000 32.000000 ]
+     /Resources 5 0 R
+     /Contents 6 0 R
+     /Parent 9 0 R
+  >>
+endobj
+
+9 0 obj
+  << /Kids [ 8 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+10 0 obj
+  << /Pages 9 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 11
+0000000000 65535 f
+0000000010 00000 n
+0000000964 00000 n
+0000000986 00000 n
+0000001702 00000 n
+0000001724 00000 n
+0000002022 00000 n
+0000002124 00000 n
+0000002145 00000 n
+0000002318 00000 n
+0000002392 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 10 0 R
+   /Size 11
+>>
+startxref
+2452
+%%EOF

+ 21 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReverseY.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "Icon.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 86 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/EditPDF/KMImageNameEditPDFReverseY.imageset/Icon.pdf

@@ -0,0 +1,86 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 8.500000 8.500000 cm
+0.056471 0.065882 0.080000 scn
+15.000000 8.000000 m
+12.635293 8.000000 l
+1.000000 8.000000 l
+0.000000 8.000000 l
+0.000000 9.000000 l
+0.000000 13.896470 l
+0.000000 15.000000 l
+1.000000 14.533334 l
+12.857142 9.000000 l
+15.000000 8.000000 l
+h
+10.492435 9.000000 m
+1.000000 9.000000 l
+1.000000 13.429804 l
+10.492435 9.000000 l
+h
+15.000000 7.000000 m
+0.000000 7.000000 l
+0.000000 0.000000 l
+15.000000 7.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  504
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 32.000000 32.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000594 00000 n
+0000000616 00000 n
+0000000789 00000 n
+0000000863 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+922
+%%EOF

+ 57 - 1
PDF Office/PDF Master/Class/PDFTools/EditPDF/Controller/KMEditPDFPopToolBarController.swift

@@ -264,7 +264,27 @@ class KMEditPDFToolbarView: NSView {
         
         let contentViewC = (self.contentViewController as? KMEditPDFPopToolBarController)
         
-        contentViewC?.itemKeys = [.color, .fontStyle, .fontAdd, .fontReduce, .fontBold, .fontItalic]
+        if self.style.contains(.text) {
+            if self.style.contains(.image) { // text + image
+                contentViewC?.itemKeys = [.alignmentLeft, .alignmentCenterX, .alignmentRight, .alignmentjustifiedX, .alignmentTop, .alignmentCenterY, .alignmentBottom, .alignmentjustifiedY]
+            } else { // text
+                if self.isMultiple {
+                    contentViewC?.itemKeys = [.color, .fontStyle, .fontAdd, .fontReduce, .fontBold, .fontItalic, .textAlignment, .alignmentLeft, .alignmentTop]
+                } else {
+                    contentViewC?.itemKeys = [.color, .fontStyle, .fontAdd, .fontReduce, .fontBold, .fontItalic, .textAlignment]
+                }
+            }
+        } else {
+            if self.style.contains(.image) { // image
+                if self.isMultiple {
+                    contentViewC?.itemKeys = [.leftRotate, .rightRotate, .reverseX, .reverseY, .crop, .replace, .export, .alignmentLeft, .alignmentTop]
+                } else {
+                    contentViewC?.itemKeys = [.leftRotate, .rightRotate, .reverseX, .reverseY, .crop, .replace, .export]
+                }
+            } else { // none
+                
+            }
+        }
     }
     
     override var isMainWindow: Bool {
@@ -355,6 +375,42 @@ extension KMEditPDFPopToolBarController: KMEditPDFToolbarViewDelegate {
             viewC.image = NSImage(named: "KMImageNameEditPDFFontBold")!
         } else if itemKey == .fontItalic {
             viewC.image = NSImage(named: "KMImageNameEditPDFFontItalic")!
+        } else if itemKey == .textAlignment {
+            viewC.image = NSImage(named: "KMImageNameEditPDFAlignCenterSelect")!
+        }
+        // 图片
+        else if itemKey == .leftRotate {
+            viewC.image = NSImage(named: "KMImageNameEditPDFRotationLeft")!
+        } else if itemKey == .rightRotate {
+            viewC.image = NSImage(named: "KMImageNameEditPDFRotationRight")!
+        } else if itemKey == .reverseX {
+            viewC.image = NSImage(named: "KMImageNameEditPDFReverseX")!
+        } else if itemKey == .reverseY {
+            viewC.image = NSImage(named: "KMImageNameEditPDFReverseY")!
+        } else if itemKey == .crop {
+            viewC.image = NSImage(named: "KMImageNameEditPDFCrop")!
+        } else if itemKey == .replace {
+            viewC.image = NSImage(named: "KMImageNameEditPDFReplace")!
+        } else if itemKey == .export {
+            viewC.image = NSImage(named: "KMImageNameEditPDFExport")!
+        }
+        // 对齐
+        else if itemKey == .alignmentLeft {
+            viewC.image = NSImage(named: "KMImageNameEditPDFImage45_1")!
+        } else if itemKey == .alignmentCenterX {
+            viewC.image = NSImage(named: "KMImageNameEditPDFImage46_1")!
+        } else if itemKey == .alignmentRight {
+            viewC.image = NSImage(named: "KMImageNameEditPDFImage47_1")!
+        } else if itemKey == .alignmentjustifiedX { 
+            viewC.image = NSImage(named: "KMImageNameEditPDFImage21_1")!
+        } else if itemKey == .alignmentTop {
+            viewC.image = NSImage(named: "KMImageNameEditPDFImage48_1")!
+        } else if itemKey == .alignmentCenterY {
+            viewC.image = NSImage(named: "KMImageNameEditPDFImage49_1")!
+        } else if itemKey == .alignmentBottom {
+            viewC.image = NSImage(named: "KMImageNameEditPDFImage50_1")!
+        } else if itemKey == .alignmentjustifiedY {
+            viewC.image = NSImage(named: "KMImageNameEditPDFImage20_1")!
         }
         return colorView
     }

+ 42 - 1
PDF Office/PDF Master/Class/PDFTools/EditPDF/Tools/KMEditPDfHanddler.swift

@@ -59,6 +59,12 @@ class KMEditPDfHanddler: NSObject {
         }
     }
     
+    var editingAreas: [CPDFEditArea] {
+        get {
+            return self.listView?.editingAreas() as? [CPDFEditArea] ?? []
+        }
+    }
+    
     func enterEditPDF() {
         self.listView?.updateActiveAnnotations([])
         self.listView?.setNeedsDisplayForVisiblePages()
@@ -97,6 +103,27 @@ class KMEditPDfHanddler: NSObject {
     
     func showPopWindow(positionRect: NSRect) {
         let win = KMEditPDFPopToolBarWindow.shared
+        let areas = self.editingAreas
+        win.isMultiple = areas.count > 1
+        var hasText = false
+        var hasImage = false
+        for area in areas {
+            if area is CPDFEditTextArea {
+                hasText = true
+            }
+            if area is CPDFEditImageArea {
+                hasImage = true
+            }
+        }
+        var style: KMEditPDFToolbarStyle = []
+        if hasText {
+            style.insert(.text)
+        }
+        if hasImage {
+            style.insert(.image)
+        }
+        win.style = style
+        
         win.show(relativeTo: positionRect, of: self.viewC!.listView, preferredEdge: .maxY)
         self.viewC?.view.window?.addChildWindow(win, ordered: .above)
         
@@ -159,7 +186,7 @@ extension KMEditPDfHanddler: CPDFViewDelegate {
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "kPDFViewEditingAreaDidChanged"), object: self.listView?.document)
         }
         
-        let areas = self.listView?.editingAreas() ?? []
+        let areas = self.listView?.editingAreas() as? [CPDFEditArea] ?? []
         if areas.isEmpty {
             let toolMode = self.listView?.toolMode ?? .none
             let annotationType = self.annotationType
@@ -247,6 +274,20 @@ extension KMEditPDfHanddler: CPDFViewDelegate {
                 self.viewC?.openRightPane()
             }
         }
+        
+        var flag: CPDFEditArea?
+        for area in areas {
+            if flag == nil {
+                flag = area
+                continue
+            }
+            if let data = flag, data.bounds.maxY < area.bounds.maxY {
+                flag = area
+            }
+        }
+        if let data = flag {
+            self.showPopWindow(positionRect: data.bounds)
+        }
     }
     
     func pdfViewEditingCropBoundsDidChanged(_ pdfView: CPDFView!, editing editArea: CPDFEditArea!) {