|
@@ -168,6 +168,11 @@ extension KMMainViewController {
|
|
|
|
|
|
func exportImageArea()->NSMenuItem {
|
|
func exportImageArea()->NSMenuItem {
|
|
let exportItem = NSMenuItem(title: NSLocalizedString("Export", comment: ""), action: #selector(menuItemEditingClick_ExportImage), target: self)
|
|
let exportItem = NSMenuItem(title: NSLocalizedString("Export", comment: ""), action: #selector(menuItemEditingClick_ExportImage), target: self)
|
|
|
|
+ let menu = NSMenu()
|
|
|
|
+ let item1 = menu.insertItem(withTitle: NSLocalizedString("PNG", comment: ""), action:#selector(exportStampImage), target: self, tag:0, at: 0)
|
|
|
|
+ let item2 = menu.insertItem(withTitle: NSLocalizedString("JPG", comment: ""), action:#selector(exportCorpImage), target: self, tag:1, at: 1)
|
|
|
|
+ let item3 = menu.insertItem(withTitle: NSLocalizedString("PDF", comment: ""), action:#selector(exportStampImage), target: self, tag:2, at: 2)
|
|
|
|
+ exportItem.submenu = menu
|
|
return exportItem
|
|
return exportItem
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1620,12 +1625,14 @@ extension KMMainViewController {
|
|
|
|
|
|
|
|
|
|
@objc func exportStampImage(sender:NSMenuItem) {
|
|
@objc func exportStampImage(sender:NSMenuItem) {
|
|
- if listView.activeAnnotation != nil && ((listView.activeAnnotation is CPDFStampAnnotation) || (listView.activeAnnotation is CPDFSignatureAnnotation)) {
|
|
|
|
|
|
+ if listView.activeAnnotation != nil && ((listView.activeAnnotation is CPDFStampAnnotation) || (listView.activeAnnotation is CPDFSignatureAnnotation)) || (self.listView.selectImageAreas != nil) {
|
|
var image : NSImage = NSImage()
|
|
var image : NSImage = NSImage()
|
|
if (listView.activeAnnotation is CPDFStampAnnotation) {
|
|
if (listView.activeAnnotation is CPDFStampAnnotation) {
|
|
image = (listView.activeAnnotation as! CPDFStampAnnotation).stampImage()
|
|
image = (listView.activeAnnotation as! CPDFStampAnnotation).stampImage()
|
|
} else if (listView.activeAnnotation is CPDFSignatureAnnotation) {
|
|
} else if (listView.activeAnnotation is CPDFSignatureAnnotation) {
|
|
image = (listView.activeAnnotation as! CPDFSignatureAnnotation).signImage
|
|
image = (listView.activeAnnotation as! CPDFSignatureAnnotation).signImage
|
|
|
|
+ } else {
|
|
|
|
+ image = self.listView.selectImageAreas.thumbnailImage(with: CGSize(width: 1920, height: 1920)) ?? NSImage()
|
|
}
|
|
}
|
|
let data = image.tiffRepresentation
|
|
let data = image.tiffRepresentation
|
|
if sender.tag == 0 {
|
|
if sender.tag == 0 {
|