3
0

2 Commits be5a9f15d4 ... d1fea2ce69

Autor SHA1 Mensagem Data
  liaoxiaoyue d1fea2ce69 Merge branch 'develop' of http://git.kdan.cc:8865/Mac_PDF/PDF_Office into develop há 1 ano atrás
  liaoxiaoyue f7dd7ebbf4 【裁剪】- 裁剪区域打印 há 1 ano atrás

+ 5 - 3
PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -473,9 +473,11 @@ extension KMMainViewController {
         let page = listView.currentPage()
         let copyPage : CPDFPage = page!.copy() as! CPDFPage
         copyPage.setBounds(rect, for: .cropBox)
-        let pdfDocument : CPDFDocument = CPDFDocument()
-        pdfDocument.insertPageObject(copyPage, at: 0)
-        
+        let image : NSImage = copyPage.thumbnail(of:(copyPage.bounds(for: .cropBox)).size)
+        let pdfDocument : PDFDocument = PDFDocument()
+        let newpage : PDFPage = PDFPage(image: image)!
+        pdfDocument.insert(newpage, at: 0)
+        KMPrintWindowController.openPrintView(document: pdfDocument)
         KMPrintWindowController.openDocument(inputDocument: self.listView?.document, inputPageRange: KMPrintPageRange(type: .allPage, selectPages: []))
     }