Browse Source

【2025】【页面编辑】界面自测处理

dinglingui 4 months ago
parent
commit
7f3bfbf7f0
17 changed files with 261 additions and 247 deletions
  1. 1 1
      PDF Office/PDF Master/Class/PDFTools/PageEdit/Window/KMPDFEditInsertBlankPageWindow.xib
  2. 2 1
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertBlankWindowController.swift
  3. 26 8
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailManager.swift
  4. 17 12
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNPageEditViewController.swift
  5. 34 174
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailBaseViewController+Action.swift
  6. 31 33
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailBaseViewController.swift
  7. 3 3
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailCollectionView.swift
  8. 13 12
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailCollectionViewItem.swift
  9. 1 1
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailImage.xcassets/KMNImageNameThumbnailPlaceImage.imageset/Contents.json
  10. BIN
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailImage.xcassets/KMNImageNameThumbnailPlaceImage.imageset/image.pdf
  11. BIN
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailImage.xcassets/KMNImageNameThumbnailPlaceImage.imageset/wrapper.pdf
  12. 1 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift
  13. 1 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/KMPDFViewController.swift
  14. 90 1
      PDF Office/PDF Master/KMClass/Tools/Tool/KMNConvertTool.swift
  15. 16 0
      PDF Office/PDF Master/KMClass/Tools/Tool/KMNTools.swift
  16. 1 1
      PDF Office/PDF Reader Pro.xcodeproj/xcshareddata/xcschemes/PDF Reader Pro DMG.xcscheme
  17. 24 0
      PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/dinglingui.xcuserdatad/xcschemes/xcschememanagement.plist

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/PageEdit/Window/KMPDFEditInsertBlankPageWindow.xib

@@ -39,7 +39,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="440" height="386"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
             <view key="contentView" misplaced="YES" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="440" height="386"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 2 - 1
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertBlankWindowController.swift

@@ -326,7 +326,8 @@ class KMNPDFInsertBlankWindowController: KMNBaseWindowController {
 
             let maxmumIndexPath = selectionIndexPaths?.max(by: { $0 < $1 })
             pageNumInput.properties.text = String((maxmumIndexPath?.item ?? 0)+1)
-            
+            pageNumInput.properties.isDisabled = false
+
             pageRadioButton.reloadData()
             pageNumInput.reloadData()
         } else {

+ 26 - 8
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailManager.swift

@@ -68,10 +68,19 @@ public class KMNThumbnail: NSObject {
         
         if(imageFilePath.isEmpty == true) {
             var thumSize = pageSize
-            if pageSize.width < 100 {
-                thumSize.width = 100
-                thumSize.height *= 100/pageSize.width
-            }
+            
+            let maxOrg = max(thumSize.width, thumSize.height)
+            let minOrg = min(thumSize.width, thumSize.height)
+
+            let maxWidth = 300.0
+            let maxHeight = 500.0
+            
+            let scanW = maxWidth / minOrg
+            let scanH = maxHeight / minOrg
+            let minScanl = min(scanW, scanH)
+            
+            thumSize.width = pageSize.width * minScanl
+            thumSize.height = pageSize.height * minScanl
             
             thumbnaiPage?.thumbnail(of: thumSize, needReset: true,completion: { pageImage in
                 if completion != nil {
@@ -98,10 +107,19 @@ public class KMNThumbnail: NSObject {
                 }
             } else {
                 var thumSize = pageSize
-                if pageSize.width < 100 {
-                    thumSize.width = 100
-                    thumSize.height *= 100/pageSize.width
-                }
+                
+                let maxOrg = max(thumSize.width, thumSize.height)
+                let minOrg = min(thumSize.width, thumSize.height)
+
+                let maxWidth = 300.0
+                let maxHeight = 500.0
+                
+                let scanW = maxWidth / minOrg
+                let scanH = maxHeight / minOrg
+                let minScanl = min(scanW, scanH)
+                
+                thumSize.width = pageSize.width * minScanl
+                thumSize.height = pageSize.height * minScanl
                 
                 thumbnaiPage?.thumbnail(of: thumSize, needReset: true,completion: { pageImage in
                     if completion != nil {

+ 17 - 12
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNPageEditViewController.swift

@@ -64,7 +64,7 @@ class KMNPageEditViewController: KMNThumbnailBaseViewController {
         
         let shareMenuItem = NSMenuItem(title: KMLocalizedString("Share"), action: nil, target: self)
         
-        shareMenuItem.submenu = NSSharingServicePicker.menu(forSharingItems: [showDocument?.documentURL ?? ""], subjectContext: "", withTarget: self, selector: NSSelectorFromString("sharePageItemAction:"), serviceDelegate: nil)
+        shareMenuItem.submenu = NSSharingServicePicker.menu(forSharingItems: [showDocument?.documentURL ?? ""], subjectContext: "", withTarget: self, selector: #selector(sharePageItemAction), serviceDelegate: nil)
         
         let showFileSizeMenuItem = NSMenuItem(title: KMLocalizedString("Display Page Size"), action: #selector(displayPageSizeAction), target: self)
         showFileSizeMenuItem.state = isShowPageSize ? .on : .off
@@ -155,13 +155,18 @@ class KMNPageEditViewController: KMNThumbnailBaseViewController {
             }
             self?.thumbnailBaseViewDelegate?.insertPDFThumbnailViewControlle?(pageEditVC: self, pdfDocment: doc)
             
-            self?.insertFormPDF(insertPages: insertPages, pageDex: insertIdx)
+            self?.insertFormPages(insertPages: insertPages, pageDex: insertIdx)
         }
         insertPDF.fileCallback = { [weak self] filePath, insertIdx in
-            self?.insertFromFilePath(fileNames: [filePath], formDex: 0, indexDex: UInt(insertIdx), selectIndexs: []) { newSelectIndexs in
+            self?.insertFromFilePath(fileNames: [filePath], formDex: 0, indexDex: UInt(insertIdx), selectIndexs: [], completionBlock: { newSelectIndexs in
                 self?.refreshDatas()
-                self?.selectPages(with: newSelectIndexs)
-            }
+                self?.collectionView.selectionIndexPaths = newSelectIndexs
+                
+                if newSelectIndexs.isEmpty { return }
+                
+                let firstIndexPath = newSelectIndexs.first
+                self?.collectionView.scrollToItems(at: [firstIndexPath ?? IndexPath(item: 0, section: 0)], scrollPosition: .top)
+            })
         }
         
         insertPDF.own_beginSheetModal(for: self.view.window, completionHandler: nil)
@@ -177,7 +182,7 @@ class KMNPageEditViewController: KMNThumbnailBaseViewController {
 
         let insertPDF = KMNPDFInsertBlankWindowController(self.showDocument, selectionIndexPaths: selectedIndexPaths)
         insertPDF.callback = { [weak self] pageSize, insertIdx in
-            self?.insertBlankPage(pageSize: pageSize, pageDex: insertIdx)
+            self?.insertBlankSize(pageSize: pageSize, pageDex: insertIdx)
         }
         insertPDF.own_beginSheetModal(for: self.view.window, completionHandler: nil)
     }
@@ -195,11 +200,11 @@ class KMNPageEditViewController: KMNThumbnailBaseViewController {
         }
         
         var error: NSError?
-        guard let document: CPDFDocument = self.openDocumentWithImageFromPasteboard(NSPasteboard.general, error: &error) else {
+        guard let document: CPDFDocument = KMNConvertTool.openDocumentWithImageFromPasteboard(NSPasteboard.general, error: &error) else {
             return
         }
         if let page: CPDFPage = (document.page(at: 0)) {
-            insertFormPDF(insertPages: [page], pageDex: maxmumIndex)
+            insertFormPages(insertPages: [page], pageDex: maxmumIndex)
         }
         
         self.thumbnailBaseViewDelegate?.insertPDFThumbnailViewControlle?(pageEditVC: self, pdfDocment: document)
@@ -257,11 +262,11 @@ class KMNPageEditViewController: KMNThumbnailBaseViewController {
     }
     
     public func undoPDFAction() {
-        
+        currentUndoManager?.undo()
     }
     
     public func redoPDFAction() {
-        
+        currentUndoManager?.redo()
     }
     
     public func canRodo()->Bool {
@@ -360,7 +365,7 @@ class KMNPageEditViewController: KMNThumbnailBaseViewController {
             _ = KMNCustomAlertView.alertView(message: KMLocalizedString("No page selected. Please select at least two pages to organize."), type: .info, fromView: self.view, point:CGPointMake(self.view.frame.origin.x + self.view.frame.size.width/2, self.view.bounds.size.height - 30))
             return
         }
-        reversePages(indexs: self.indexpathsToIndexs(indexpaths: selectedIndexPaths))
+        reversePages(indexs:KMNTools.indexpathsToIndexs(indexpaths: selectedIndexPaths))
     }
     
     @objc public func rotatePageLeftAction() {
@@ -553,7 +558,7 @@ class KMNPageEditViewController: KMNThumbnailBaseViewController {
         try? FileManager.default.removeItem(atPath: folderPath)
         
         let pdfdocument = CPDFDocument()
-        let ret = pdfdocument?.importPages(indexpathsToIndexs(indexpaths: indexpaths), from: doucument, at: 0) ?? false
+        let ret = pdfdocument?.importPages(KMNTools.indexpathsToIndexs(indexpaths: indexpaths), from: doucument, at: 0) ?? false
         let url = URL(fileURLWithPath: folderPath)
         if ret {
             let success = pdfdocument?.write(toFile: folderPath)

+ 34 - 174
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailBaseViewController+Action.swift

@@ -8,72 +8,12 @@
 import Foundation
 
 extension KMNThumbnailBaseViewController {
-    public func fileNameWithSelectedPages(_ itemIndexes: IndexSet) -> String {
-        var pagesName = ""
-        if (itemIndexes.count > 1) {
-            pagesName.append(" pages")
-        } else {
-            pagesName.append(" page")
-        }
-        
-        let docmentName = showDocument?.documentURL.deletingPathExtension().lastPathComponent ?? ""
-        let tFileName = String(format: "%@ %@", pagesName,KMNTools.parseIndexSet(indexSet: itemIndexes))
-        return String(format: "%@%@", docmentName,tFileName)
-    }
-    
-    private func convertTIFFDataToPDF(_ tiffData: Data) -> Data? {
-        guard let imsrc = CGImageSourceCreateWithData(tiffData as CFData, [kCGImageSourceTypeIdentifierHint: kUTTypeTIFF] as CFDictionary), CGImageSourceGetCount(imsrc) > 0, let cgImage = CGImageSourceCreateImageAtIndex(imsrc, 0, nil) else { return nil }
-        let pdfData = NSMutableData(capacity: tiffData.count)
-        let consumer = CGDataConsumer(data: pdfData! as CFMutableData)!
-        
-        var rect = CGRect(x: 0, y: 0, width: CGFloat(cgImage.width), height: CGFloat(cgImage.height))
-        let ctxt = CGContext(consumer: consumer, mediaBox: &rect, nil)
-        ctxt!.beginPDFPage(nil)
-        ctxt!.draw(cgImage, in: rect)
-        ctxt!.endPDFPage()
-        ctxt!.closePDF()
-        
-        return pdfData as? Data
-    }
-    
-    public func selectPages(with array: [Int]) {
-        var selectIndexPaths: Set<IndexPath> = []
-
-        for i in 0..<(showDocument?.pageCount ?? 0) {
-            if array.contains(Int(i)) {
-                selectIndexPaths.insert(IndexPath(item: Int(i), section: 0))
-            }
-        }
-
-        collectionView.selectionIndexPaths = selectIndexPaths
-
-        if selectIndexPaths.isEmpty { return }
-        
-        let firstIndexPath = selectIndexPaths.first
-        collectionView.scrollToItems(at: [firstIndexPath ?? IndexPath(item: 0, section: 0)], scrollPosition: .top)
-    }
     
-   public func indexpathsToIndexs(indexpaths: Set<IndexPath>) -> IndexSet {
-        var indexs = IndexSet()
-        for indexPath in indexpaths {
-            indexs.insert(indexPath.item)
-        }
-        return indexs
-    }
-    
-    public func indexsToIndexpaths(indexs: IndexSet) -> Set<IndexPath> {
-        var indexpaths = Set<IndexPath>()
-        for index in indexs {
-            indexpaths.insert(IndexPath(item: index, section: 0))
-        }
-        return indexpaths
-    }
-    
-    public func insertFormPDF(insertPages: [CPDFPage],pageDex:Int) {
+    public func insertFormPages(insertPages: [CPDFPage],pageDex:Int) {
         var pageIndexDex: Int = pageDex
         var indexpaths = Set<IndexPath>()
         for page in insertPages {
-           let isSuccessFul = showDocument?.insertPageObject(page, at: UInt(pageIndexDex))
+            let isSuccessFul = showDocument?.insertPageObject(page, at: UInt(pageIndexDex))
             if(isSuccessFul == true) {
                 indexpaths.insert(IndexPath(item: pageIndexDex, section: 0))
                 pageIndexDex += 1
@@ -85,49 +25,19 @@ extension KMNThumbnailBaseViewController {
         collectionView.selectionIndexPaths = indexpaths
     }
     
-    public func insertBlankPage(pageSize: CGSize,pageDex:Int) {
+    public func insertBlankSize(pageSize: CGSize,pageDex:Int) {
         var indexpaths = Set<IndexPath>()
         let isSuccessFul = showDocument?.insertBlankPage(pageSize: pageSize, at: pageDex)
-         if(isSuccessFul == true) {
-             indexpaths.insert(IndexPath(item: pageDex, section: 0))
-         }
-
+        if(isSuccessFul == true) {
+            indexpaths.insert(IndexPath(item: pageDex, section: 0))
+        }
+        
         refreshDatas()
         collectionView.reloadData()
         collectionView.scrollToItems(at: indexpaths, scrollPosition: .centeredVertically)
         collectionView.selectionIndexPaths = indexpaths
     }
     
-    public func openDocumentWithImageFromPasteboard(_ pboard: NSPasteboard, error outError: AutoreleasingUnsafeMutablePointer<NSError?>?) -> CPDFDocument? {
-        var document: CPDFDocument? = nil
-        var data: Data? = nil
-        
-        if pboard.canReadItem(withDataConformingToTypes: [NSPasteboard.PasteboardType.pdf.rawValue]) {
-            data = pboard.data(forType: NSPasteboard.PasteboardType.pdf)
-        } else if pboard.canReadItem(withDataConformingToTypes: [NSPasteboard.PasteboardType.postScript.rawValue]) {
-            data = pboard.data(forType: NSPasteboard.PasteboardType.postScript)
-        } else if pboard.canReadItem(withDataConformingToTypes: [NSPasteboard.PasteboardType.tiff.rawValue]) {
-            data = convertTIFFDataToPDF(pboard.data(forType: NSPasteboard.PasteboardType.tiff) ?? Data())
-        } else {
-            let images = pboard.readObjects(forClasses: [NSImage.self], options: [:])
-            let strings = pboard.readObjects(forClasses: [NSAttributedString.self], options: [:])
-            if images?.count ?? 0 > 0 {
-                data = convertTIFFDataToPDF((images![0] as AnyObject).tiffRepresentation!)
-            } else if strings?.count ?? 0 > 0 {
-                data = KMOCTool.convertStringsToPDF(withString: strings ?? [""]) // convertStringsToPDF(strings!)
-            }
-        }
-        
-        if let data = data {
-            document = CPDFDocument(data: data)
-            
-        } else if let outError = outError {
-            outError.pointee = NSError(domain: "SKDocumentErrorDomain", code: 3, userInfo: [NSLocalizedDescriptionKey: NSLocalizedString("Unable to load data from clipboard", comment: "Error description")])
-        }
-        
-        return document
-    }
-    
     public func insertImageFilePath(imagePath:String,pageDex:Int)->Bool{
         var isSuccessFul:Bool = false
         if (FileManager.default.fileExists(atPath: imagePath)) {
@@ -148,7 +58,7 @@ extension KMNThumbnailBaseViewController {
                     pageRotate = 270
                 } else if (pageRotate == 450) {
                     pageRotate = 90
-
+                    
                 }
                 page.rotation = pageRotate
                 
@@ -161,7 +71,6 @@ extension KMNThumbnailBaseViewController {
         
         collectionView.reloadItems(at: tIndexPaths) // Ensure correct type conversion
         collectionView.selectionIndexPaths = tIndexPaths
-
     }
     
     public func reversePages(indexs: IndexSet) {
@@ -180,15 +89,15 @@ extension KMNThumbnailBaseViewController {
                 }
                 res = doc.exchangePage(at: UInt(first), withPageAt: UInt(last))
                 if res {
-                    theIdxs.remove(first)                    
+                    theIdxs.remove(first)
                     theIdxs.remove(last)
-                   
+                    
                 }
             }
             if res {
                 refreshDatas()
-                let selected_indexpaths = self.indexsToIndexpaths(indexs: indexs)
-
+                let selected_indexpaths = KMNTools.indexsToIndexpaths(indexs: indexs)
+                
                 collectionView.reloadItems(at: selected_indexpaths)
                 
                 collectionView.selectionIndexPaths = selected_indexpaths
@@ -204,10 +113,10 @@ extension KMNThumbnailBaseViewController {
         var index = targetIndexpaths.sorted().first!.item
         var tIndexPaths: Set<IndexPath> = []
         
-        var indexSet = indexpathsToIndexs(indexpaths: targetIndexpaths)
+        var indexSet = KMNTools.indexpathsToIndexs(indexpaths: targetIndexpaths)
         
         showDocument?.removePage(at: indexSet)
-
+        
         for document in documents {
             for i in 0 ..< document.pageCount {
                 let page = document.page(at: i)
@@ -219,18 +128,15 @@ extension KMNThumbnailBaseViewController {
         }
         
         refreshDatas()
-
         collectionView.reloadData()
-        
         collectionView.selectionIndexPaths = tIndexPaths
-
     }
     
     public func deletePages(indexpaths:Set<IndexPath>) {
         var changeIndex:IndexSet = []
         var tIndexPaths: Set<IndexPath> = []
         tIndexPaths = indexpaths
-
+        
         for targetIndexPath in tIndexPaths {
             changeIndex.insert(targetIndexPath.item)
             
@@ -238,16 +144,16 @@ extension KMNThumbnailBaseViewController {
             if(cellView != nil) {
                 cellView?.thumbnailMode.removeCacheImage()
             }
-
+            
         }
         showDocument?.removePage(at: changeIndex)
         refreshDatas()
-        collectionView.deleteItems(at: tIndexPaths)
+        collectionView.reloadData()
     }
     
     public func movePages(pages:[CPDFPage],destinationDex:Int) {
         var destinationIndex = destinationDex
-   
+        
         for dragPage in dragLocalityPages {
             let dragIndex = dragPage.pageIndex()
             if destinationIndex > dragIndex {
@@ -259,18 +165,22 @@ extension KMNThumbnailBaseViewController {
             destinationIndex += 1
         }
         
-        var selectArray:[Int] = []
+        var selectIndexPaths: Set<IndexPath> = []
+        
         for dragPage in dragLocalityPages {
             let dragIndex = dragPage.pageIndex()
-            selectArray.append(Int(dragIndex))
+            selectIndexPaths.insert(IndexPath(item: Int(dragIndex), section: 0))
         }
         
         refreshDatas()
         collectionView.reloadData()
-        self.selectPages(with: selectArray)
+        collectionView.selectionIndexPaths = selectIndexPaths
+        if selectIndexPaths.isEmpty { return }
+        let firstIndexPath = selectIndexPaths.first
+        collectionView.scrollToItems(at: [firstIndexPath ?? IndexPath(item: 0, section: 0)], scrollPosition: .top)
     }
     
-    public func insertFromFilePath(fileNames:[String],formDex:Int,indexDex:UInt,selectIndexs:[Int],completionBlock:@escaping ([Int])->Void)-> Void {
+    public func insertFromFilePath(fileNames:[String],formDex:Int,indexDex:UInt,selectIndexs:Set<IndexPath>,completionBlock:@escaping (Set<IndexPath>)->Void)-> Void {
         let path = fileNames[formDex]
         var insertDex = indexDex
         var tSelectIndex = selectIndexs
@@ -285,7 +195,7 @@ extension KMNThumbnailBaseViewController {
                         for i in 0 ..< pdf.pageCount {
                             let insertPage = pdf.page(at: i)
                             self.showDocument?.insertPageObject(insertPage, at: insertDex)
-                            tSelectIndex.append(Int(insertDex))
+                            tSelectIndex.insert(IndexPath(item: Int(insertDex), section:0))
                             insertDex += 1
                         }
                         
@@ -297,14 +207,13 @@ extension KMNThumbnailBaseViewController {
                         } else {
                             return completionBlock(tSelectIndex)
                         }
-
                     }
                 }
             } else {
                 for i in 0 ..< pdf.pageCount {
                     let insertPage = pdf.page(at: i)
                     showDocument?.insertPageObject(insertPage ?? CPDFPage(), at: insertDex)
-                    tSelectIndex.append(Int(insertDex))
+                    tSelectIndex.insert(IndexPath(item: Int(insertDex), section:0))
                     insertDex += 1
                 }
                 var tFormDex = formDex
@@ -319,10 +228,9 @@ extension KMNThumbnailBaseViewController {
             }
         } else if supportDragFileTypes().contains(pathExtension) {
             if KMConvertPDFManager.supportImages().contains(pathExtension) {
-
-              let isSueccessFul = insertImageFilePath(imagePath: path, pageDex: Int(indexDex))
+                let isSueccessFul = insertImageFilePath(imagePath: path, pageDex: Int(indexDex))
                 if(isSueccessFul) {
-                    tSelectIndex.append(Int(insertDex))
+                    tSelectIndex.insert(IndexPath(item: Int(insertDex), section:0))
                     insertDex += 1
                 }
                 
@@ -335,18 +243,18 @@ extension KMNThumbnailBaseViewController {
                 }
                 
             } else {
-                convertOffice(filePath: path) { convertPDFPath in
+                KMNConvertTool.convertOffice(filePath: path) { convertPDFPath in
                     if (convertPDFPath != nil) {
                         let pathExtension = URL(fileURLWithPath: convertPDFPath!).pathExtension.lowercased()
                         if pathExtension == "pdf", let pdf = CPDFDocument(url: URL(fileURLWithPath: convertPDFPath!)) {
                             for i in 0 ..< pdf.pageCount {
                                 let insertPage = pdf.page(at: i)
                                 self.showDocument?.insertPageObject(insertPage, at: insertDex)
-                                tSelectIndex.append(Int(insertDex))
+                                tSelectIndex.insert(IndexPath(item: Int(insertDex), section:0))
                                 insertDex += 1
                             }
                             self.thumbnailBaseViewDelegate?.insertPDFThumbnailViewControlle?(pageEditVC: self, pdfDocment: pdf)
-
+                            
                             var tFormDex = formDex
                             tFormDex += 1
                             if(tFormDex < fileNames.count) {
@@ -359,57 +267,11 @@ extension KMNThumbnailBaseViewController {
                     }
                 }
             }
-            
-        }
-    }
-    
-    private func convertOffice(filePath: String, completionBlock:@escaping (String?)->Void) -> Void {
-        let today = Date()
-        let dateFormatter = DateFormatter()
-        dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
-        let dateString = dateFormatter.string(from: today)
-
-        let folderPath = "convertToPDF_office_" + dateString + "." + "pdf"
-
-        let savePath: String? = folderPath.kUrlToPDFFolderPath() as String
-        
-        KMConvertPDFManager.convertFile(filePath, savePath: savePath!) { success, errorDic in
-            if errorDic != nil || !success || !FileManager.default.fileExists(atPath: savePath!) {
-                
-                if FileManager.default.fileExists(atPath: savePath!) {
-                    try?FileManager.default.removeItem(atPath: savePath!)
-                }
-                let alert = NSAlert.init()
-                alert.alertStyle = .critical
-                var infoString = ""
-                if errorDic != nil {
-                    for key in (errorDic! as Dictionary).keys {
-                        infoString = infoString.appendingFormat("%@\n", errorDic![key] as! CVarArg)
-                    }
-                }
-                alert.informativeText = NSLocalizedString("Please install Microsoft Office to create PDFs from Office files", comment: "")
-                alert.messageText = NSLocalizedString("Failed to Create PDF", comment: "")
-                alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
-                alert.runModal()
-                completionBlock(nil)
-                return
-            }
-            
-            if !savePath!.isPDFValid() {
-                let alert = NSAlert()
-                alert.alertStyle = .critical
-                alert.messageText = NSLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.", comment: "")
-                alert.runModal()
-                completionBlock(nil)
-                return
-            }
-            completionBlock(savePath)
         }
-        
     }
     
     public func extractPages(indexpaths: Set<IndexPath>, oneDocumentPerPage: Bool, callback: @escaping KMResultBlock) {
-        let pageIndexs = self.indexpathsToIndexs(indexpaths: indexpaths)
+        let pageIndexs = KMNTools.indexpathsToIndexs(indexpaths: indexpaths)
         let oneDocument = !oneDocumentPerPage
         let document = self.showDocument!
         /// 提取的页面
@@ -453,7 +315,6 @@ extension KMNThumbnailBaseViewController {
                     }
                 }
             }
-            return
         } else {
             let panel = NSOpenPanel()
             panel.canChooseFiles = false
@@ -489,7 +350,6 @@ extension KMNThumbnailBaseViewController {
                                 return
                             }
                             NSWorkspace.shared.activateFileViewerSelecting(successArray!)
-                                
                             callback(.success, successArray ?? NSURL())
                         }
                     }

+ 31 - 33
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailBaseViewController.swift

@@ -27,26 +27,27 @@ enum KMNThumbnailChoosePageStyle: Int {
 internal let kmnThumLocalForDraggedTypes = NSPasteboard.PasteboardType(rawValue: "kmnThumLocalForDraggedTypes")
 
 class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDelegate, NSCollectionViewDataSource,NSCollectionViewDelegateFlowLayout {
+    let subTitleHeight: CGFloat = 20.0
+    let maxCellHeight: CGFloat = 280.0
     
     weak open var thumbnailBaseViewDelegate: KMNThumbnailBaseViewDelegate?
     
     @IBOutlet var backViewBox: NSBox!
     @IBOutlet var collectionView: KMNThumbnailCollectionView!
-    
-    let subTitleHeight: CGFloat = 20.0
-    
-    let maxCellHeight: CGFloat = 280.0
-    
+        
     private var currentDocument:CPDFDocument?
+    private var thumbnails:[KMNThumbnail] = []
+    private var isChangeIndexPaths = false
     
+    public var dragLocalityPages: [CPDFPage] = []
+
     public var currentUndoManager:UndoManager?
     
+    public var isAdjustWidth:Bool = false
+    
     public var showDocument: CPDFDocument? {
         return currentDocument
     }
-    private var thumbnails:[KMNThumbnail] = []
-    
-    private var isChangeIndexPaths = false
     
     public var thumbnailChoosePageStyle:KMNThumbnailChoosePageStyle = .custom {
         didSet {
@@ -122,13 +123,6 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
             collectionView.scrollToItems(at: indexpaths, scrollPosition: .top)
         }
     }
-    
-    public var clickPageIndex: Int{
-        let minIndexPath = selectionIndexPaths.min(by: { $0.item < $1.item })
-        return minIndexPath?.item ?? 0
-    }
-    
-    public var isAdjustWidth:Bool = false
         
     public var isShowPageSize:Bool = false {
         didSet {
@@ -138,7 +132,7 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
                     pageSize.height += subTitleHeight
                 } else {
                     pageSize.height -= subTitleHeight
-
+                    
                 }
                 pageThumbnailSize = pageSize
                 collectionView.reloadData()
@@ -152,9 +146,7 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
         }
     }
     public let defaultItemSize = NSMakeSize(185.0, 260)
-    
-    var dragLocalityPages: [CPDFPage] = []
-    
+        
     deinit {
         thumbnailBaseViewDelegate = nil
         KMPrint("KMNThumbnailBaseViewController deinit.")
@@ -196,30 +188,30 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
         collectionView.registerForDraggedTypes([.fileURL])
         collectionView.setDraggingSourceOperationMask(.every, forLocal: false)
         collectionView.setDraggingSourceOperationMask(.every, forLocal: true)
-
+        
         refreshDatas()
     }
     
     public func exitCurrentView() {
-        thumbnailBaseViewDelegate?.clickThumbnailViewControlle?(pageEditVC: self, currentIndex: clickPageIndex)
+        let minIndexPath = selectionIndexPaths.max(by: { $0.item < $1.item })
+        thumbnailBaseViewDelegate?.clickThumbnailViewControlle?(pageEditVC: self, currentIndex: minIndexPath?.item ?? 0)
     }
     
     public func supportDragFileTypes()->[String] {
         let supportFiles = KMNConvertTool.pdfExtensions + KMConvertPDFManager.supportFileType()
-
         return supportFiles
     }
     
     public func refreshDatas() {
         thumbnails = []
         if currentDocument != nil {
-            for i in 0 ... currentDocument!.pageCount {
+            for i in 0 ... currentDocument!.pageCount - 1 {
                 let thumbnail = KMNThumbnail.init(document: currentDocument!, currentPageIndex: Int(i))
                 thumbnails.append(thumbnail)
             }
         }
     }
-
+    
     // MARK: - NSCollectionViewDataSource
     func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int {
         return thumbnails.count
@@ -231,7 +223,7 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
         item.doubleClickBack = { [weak self] in
             self?.thumbnailBaseViewDelegate?.clickThumbnailViewControlle?(pageEditVC: self, currentIndex: indexPath.item)
         }
-
+        
         item.thumbnailMode = thumbnails[indexPath.item]
         return item
     }
@@ -239,7 +231,7 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
     func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set<IndexPath>) {
         if isChangeIndexPaths == false {
             let indexpathsz = self.collectionView.selectionIndexPaths
-            let dex:IndexSet = indexpathsToIndexs(indexpaths: indexpathsz)
+            let dex:IndexSet = KMNTools.indexpathsToIndexs(indexpaths: indexpathsz)
             let selectedIndexPathsString = KMNTools.parseIndexSet(indexSet: dex)
             
             thumbnailBaseViewDelegate?.changeIndexPathsThumbnailViewControlle?(pageEditVC: self, selectionIndexPaths: indexpathsz, selectionStrings: selectedIndexPathsString)
@@ -249,7 +241,7 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
     func collectionView(_ collectionView: NSCollectionView, didDeselectItemsAt indexPaths: Set<IndexPath>) {
         if isChangeIndexPaths == false {
             let indexpathsz = self.collectionView.selectionIndexPaths
-            let dex:IndexSet = indexpathsToIndexs(indexpaths: indexpathsz)
+            let dex:IndexSet = KMNTools.indexpathsToIndexs(indexpaths: indexpathsz)
             let selectedIndexPathsString = KMNTools.parseIndexSet(indexSet: dex)
             
             thumbnailBaseViewDelegate?.changeIndexPathsThumbnailViewControlle?(pageEditVC: self, selectionIndexPaths: indexpathsz, selectionStrings: selectedIndexPathsString)
@@ -352,7 +344,7 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
             }
         }
     }
-
+    
     func collectionView(_ collectionView: NSCollectionView, validateDrop draggingInfo: NSDraggingInfo, proposedIndexPath proposedDropIndexPath: AutoreleasingUnsafeMutablePointer<NSIndexPath>, dropOperation proposedDropOperation: UnsafeMutablePointer<NSCollectionView.DropOperation>) -> NSDragOperation {
         let pboard = draggingInfo.draggingPasteboard
         
@@ -372,7 +364,7 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
         }
         return []
     }
-
+    
     func collectionView(_ collectionView: NSCollectionView,
                         acceptDrop draggingInfo: NSDraggingInfo,
                         indexPath: IndexPath,
@@ -385,9 +377,16 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
             let index = indexPath.item
             
             if let fileNames = pboard.propertyList(forType: .fileURL) as? [String] {
-                insertFromFilePath(fileNames: fileNames, formDex: 0, indexDex: UInt(index), selectIndexs: []) { zSelectIndexs in
+                insertFromFilePath(fileNames: fileNames, formDex: 0, indexDex: UInt(index), selectIndexs: []) { newSelectIndexs in
                     self.refreshDatas()
-                    self.selectPages(with: zSelectIndexs)
+                    self.collectionView.reloadData()
+                    
+                    self.collectionView.selectionIndexPaths = newSelectIndexs
+                    
+                    if newSelectIndexs.isEmpty { return }
+                    
+                    let firstIndexPath = newSelectIndexs.first
+                    self.collectionView.scrollToItems(at: [firstIndexPath ?? IndexPath(item: 0, section: 0)], scrollPosition: .top)
                 }
                 
                 return true
@@ -395,12 +394,11 @@ class KMNThumbnailBaseViewController: KMNBaseViewController,NSCollectionViewDele
         }
         return false
     }
-
+    
     func collectionView(_ collectionView: NSCollectionView,
                         draggingSession session: NSDraggingSession,
                         endedAt screenPoint: NSPoint,
                         dragOperation operation: NSDragOperation) {
         dragLocalityPages = []
     }
-
 }

+ 3 - 3
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailCollectionView.swift

@@ -9,11 +9,11 @@ import Cocoa
 
 class KMNThumbnailCollectionView: NSCollectionView {
     var menuClickedAction: ((_ clickPoint: NSPoint) -> NSMenu)?
-
-
+    
+    
     override func draw(_ dirtyRect: NSRect) {
         super.draw(dirtyRect)
-
+        
         // Drawing code here.
     }
     

+ 13 - 12
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailCollectionViewItem.swift

@@ -17,14 +17,22 @@ class KMNThumbnailCollectionViewItem: NSCollectionViewItem {
     
     public var thumbnailMode: KMNThumbnail = KMNThumbnail.init() {
         didSet {
+            var orgPageHeight = thumbnailMode.pageSize.height
+            var orgPagewidth = thumbnailMode.pageSize.width
+            
+            if (thumbnailMode.thumbnaiPage?.rotation ?? 0) % 180 != 0 {
+                orgPageHeight = thumbnailMode.pageSize.width
+                orgPagewidth = thumbnailMode.pageSize.height
+            }
+            
             cardFileView.properties = ComponentCardFileProperty(folder: false,
                                                                 state: .normal,
                                                                 icon: NSImage.init(named: "KMNImageNameThumbnailPlaceImage"),
                                                                 text: String(format: "%d", (thumbnailMode.pageIndex+1)),
-                                                                subText: String(format: "%.0f x %.0fmm", thumbnailMode.pageSize.width, thumbnailMode.pageSize.height),
+                                                                subText: String(format: "%.0f x %.0fmm", (thumbnailMode.pageSize.width / 595 * 210), (thumbnailMode.pageSize.height / 842 * 297)),
                                                                 markIcon:NSImage.init(named: "KMNImageNameThumbnailBookMark"))
             cardFileView.properties.isShowSubText = isShowFileSize
-
+            
             cardFileView.properties.propertyInfo.infoLabelHeight = 16.0
             cardFileView.properties.isShowMarkIcon = thumbnailMode.isHoveBookMark
             cardFileView.reloadData()
@@ -34,23 +42,16 @@ class KMNThumbnailCollectionViewItem: NSCollectionViewItem {
             var maxThumCellHeight = self.view.frame.size.height
             
             maxThumCellHeight -= cardFileView.properties.propertyInfo.infoLabelHeight
-
+            
             maxThumCellHeight -= cardFileView.properties.propertyInfo.subLabelHeight
             
             maxThumCellHeight -= (cardFileView.properties.propertyInfo.topIconOffset + cardFileView.properties.propertyInfo.bottomOffset + cardFileView.properties.propertyInfo.topLabelOffset) //间隔
-            var orgPageHeight = thumbnailMode.pageSize.height
-            var orgPagewidth = thumbnailMode.pageSize.width
-            
-            if (thumbnailMode.thumbnaiPage?.rotation ?? 0) % 180 != 0 {
-                orgPageHeight = thumbnailMode.pageSize.width
-                orgPagewidth = thumbnailMode.pageSize.height
-            }
             
             let minimumValue = min(maxThumCellHeight/orgPageHeight, maxThumCellWidth/orgPagewidth)
             
             let relCellHeight = orgPageHeight * minimumValue
             let relCellWidth = orgPagewidth * minimumValue
-
+            
             thumbnailMode.generateThumImage { image in
                 self.cardFileView.properties.propertyInfo.iconImageWidth = relCellWidth
                 self.cardFileView.properties.propertyInfo.iconImageHeight = relCellHeight
@@ -72,7 +73,7 @@ class KMNThumbnailCollectionViewItem: NSCollectionViewItem {
     }
     
     public var isShowFileSize :Bool = false
-
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         

+ 1 - 1
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailImage.xcassets/KMNImageNameThumbnailPlaceImage.imageset/Contents.json

@@ -1,7 +1,7 @@
 {
   "images" : [
     {
-      "filename" : "image.pdf",
+      "filename" : "wrapper.pdf",
       "idiom" : "universal"
     }
   ],

BIN
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailImage.xcassets/KMNImageNameThumbnailPlaceImage.imageset/image.pdf


BIN
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailImage.xcassets/KMNImageNameThumbnailPlaceImage.imageset/wrapper.pdf


+ 1 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -441,6 +441,7 @@ import Cocoa
             bottomContendBox.addSubview(pageEditViewController!.view)
             pageEditViewController?.view.frame = bottomContendBox.bounds
             pageEditViewController?.thumbnailBaseViewDelegate = self
+            pageEditViewController?.selectionIndexPaths = [IndexPath(item: listView.currentPageIndex, section: 0)]
             pageEditViewController?.view.autoresizingMask = [.width,.height]
         }
     }

+ 1 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/KMPDFViewController.swift

@@ -218,6 +218,7 @@ class KMPDFViewController: NSViewController {
         if(pageEditViewController != nil) {
             bottomContendBox.addSubview(pageEditViewController!.view)
             pageEditViewController?.view.frame = bottomContendBox.bounds
+            pageEditViewController?.selectionIndexPaths = [IndexPath(item: pdfView.currentPageIndex, section: 0)]
             pageEditViewController?.thumbnailBaseViewDelegate = self
             pageEditViewController?.view.autoresizingMask = [.width,.height]
         }

+ 90 - 1
PDF Office/PDF Master/KMClass/Tools/Tool/KMNConvertTool.swift

@@ -20,6 +20,95 @@ class KMNConvertTool: NSObject {
     class func supportPDFFileType() -> [String] {
         return pdfExtensions
     }
-
+    
+    class func convertOffice(filePath: String, completionBlock:@escaping (String?)->Void) -> Void {
+        let today = Date()
+        let dateFormatter = DateFormatter()
+        dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
+        let dateString = dateFormatter.string(from: today)
+        
+        let folderPath = "convertToPDF_office_" + dateString + "." + "pdf"
+        
+        let savePath: String? = folderPath.kUrlToPDFFolderPath() as String
+        
+        KMConvertPDFManager.convertFile(filePath, savePath: savePath!) { success, errorDic in
+            if errorDic != nil || !success || !FileManager.default.fileExists(atPath: savePath!) {
+                
+                if FileManager.default.fileExists(atPath: savePath!) {
+                    try?FileManager.default.removeItem(atPath: savePath!)
+                }
+                let alert = NSAlert.init()
+                alert.alertStyle = .critical
+                var infoString = ""
+                if errorDic != nil {
+                    for key in (errorDic! as Dictionary).keys {
+                        infoString = infoString.appendingFormat("%@\n", errorDic![key] as! CVarArg)
+                    }
+                }
+                alert.informativeText = NSLocalizedString("Please install Microsoft Office to create PDFs from Office files", comment: "")
+                alert.messageText = NSLocalizedString("Failed to Create PDF", comment: "")
+                alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+                alert.runModal()
+                completionBlock(nil)
+                return
+            }
+            
+            if !savePath!.isPDFValid() {
+                let alert = NSAlert()
+                alert.alertStyle = .critical
+                alert.messageText = NSLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.", comment: "")
+                alert.runModal()
+                completionBlock(nil)
+                return
+            }
+            completionBlock(savePath)
+        }
+        
+    }
+    
+    class func openDocumentWithImageFromPasteboard(_ pboard: NSPasteboard, error outError: AutoreleasingUnsafeMutablePointer<NSError?>?) -> CPDFDocument? {
+        var document: CPDFDocument? = nil
+        var data: Data? = nil
+        
+        if pboard.canReadItem(withDataConformingToTypes: [NSPasteboard.PasteboardType.pdf.rawValue]) {
+            data = pboard.data(forType: NSPasteboard.PasteboardType.pdf)
+        } else if pboard.canReadItem(withDataConformingToTypes: [NSPasteboard.PasteboardType.postScript.rawValue]) {
+            data = pboard.data(forType: NSPasteboard.PasteboardType.postScript)
+        } else if pboard.canReadItem(withDataConformingToTypes: [NSPasteboard.PasteboardType.tiff.rawValue]) {
+            data = KMNConvertTool.convertTIFFDataToPDF(pboard.data(forType: NSPasteboard.PasteboardType.tiff) ?? Data())
+        } else {
+            let images = pboard.readObjects(forClasses: [NSImage.self], options: [:])
+            let strings = pboard.readObjects(forClasses: [NSAttributedString.self], options: [:])
+            if images?.count ?? 0 > 0 {
+                data = KMNConvertTool.convertTIFFDataToPDF((images![0] as AnyObject).tiffRepresentation!)
+            } else if strings?.count ?? 0 > 0 {
+                data = KMOCTool.convertStringsToPDF(withString: strings ?? [""]) // convertStringsToPDF(strings!)
+            }
+        }
+        
+        if let data = data {
+            document = CPDFDocument(data: data)
+            
+        } else if let outError = outError {
+            outError.pointee = NSError(domain: "SKDocumentErrorDomain", code: 3, userInfo: [NSLocalizedDescriptionKey: NSLocalizedString("Unable to load data from clipboard", comment: "Error description")])
+        }
+        
+        return document
+    }
+    
+    class func convertTIFFDataToPDF(_ tiffData: Data) -> Data? {
+        guard let imsrc = CGImageSourceCreateWithData(tiffData as CFData, [kCGImageSourceTypeIdentifierHint: kUTTypeTIFF] as CFDictionary), CGImageSourceGetCount(imsrc) > 0, let cgImage = CGImageSourceCreateImageAtIndex(imsrc, 0, nil) else { return nil }
+        let pdfData = NSMutableData(capacity: tiffData.count)
+        let consumer = CGDataConsumer(data: pdfData! as CFMutableData)!
+        
+        var rect = CGRect(x: 0, y: 0, width: CGFloat(cgImage.width), height: CGFloat(cgImage.height))
+        let ctxt = CGContext(consumer: consumer, mediaBox: &rect, nil)
+        ctxt!.beginPDFPage(nil)
+        ctxt!.draw(cgImage, in: rect)
+        ctxt!.endPDFPage()
+        ctxt!.closePDF()
+        
+        return pdfData as? Data
+    }
 
 }

+ 16 - 0
PDF Office/PDF Master/KMClass/Tools/Tool/KMNTools.swift

@@ -9,6 +9,22 @@ import Cocoa
 
 class KMNTools: NSObject {
     
+    class func indexpathsToIndexs(indexpaths: Set<IndexPath>) -> IndexSet {
+        var indexs = IndexSet()
+        for indexPath in indexpaths {
+            indexs.insert(indexPath.item)
+        }
+        return indexs
+    }
+    
+    class func indexsToIndexpaths(indexs: IndexSet) -> Set<IndexPath> {
+        var indexpaths = Set<IndexPath>()
+        for index in indexs {
+            indexpaths.insert(IndexPath(item: index, section: 0))
+        }
+        return indexpaths
+    }
+    
     class func newParseSelectedIndexs(selectedIndex: Array<Int>) -> String {
         if (selectedIndex.count == 0) {
             return ""

+ 1 - 1
PDF Office/PDF Reader Pro.xcodeproj/xcshareddata/xcschemes/PDF Reader Pro DMG.xcscheme

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
    LastUpgradeVersion = "1520"
-   version = "1.7">
+   version = "1.8">
    <BuildAction
       parallelizeBuildables = "YES"
       buildImplicitDependencies = "YES">

+ 24 - 0
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/dinglingui.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>SchemeUserState</key>
+	<dict>
+		<key>PDF Reader Pro DMG.xcscheme_^#shared#^_</key>
+		<dict>
+			<key>orderHint</key>
+			<integer>1</integer>
+		</dict>
+		<key>PDF Reader Pro Edition.xcscheme_^#shared#^_</key>
+		<dict>
+			<key>orderHint</key>
+			<integer>2</integer>
+		</dict>
+		<key>PDF Reader Pro.xcscheme_^#shared#^_</key>
+		<dict>
+			<key>orderHint</key>
+			<integer>0</integer>
+		</dict>
+	</dict>
+</dict>
+</plist>