Browse Source

【OCToSwift】CPDFPage+PDFListView

tangchao 1 year ago
parent
commit
569c669bfb

+ 0 - 10
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -3267,9 +3267,6 @@
 		F36EB6CC2987C9FE004C25FB /* KMDocumentAIViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F36EB6C82987C9FE004C25FB /* KMDocumentAIViewController.xib */; };
 		F36EB6CD2987C9FE004C25FB /* KMDocumentAIViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F36EB6C82987C9FE004C25FB /* KMDocumentAIViewController.xib */; };
 		F36EB6CE2987C9FE004C25FB /* KMDocumentAIViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F36EB6C82987C9FE004C25FB /* KMDocumentAIViewController.xib */; };
-		F37322DB292DF9410013862C /* CPDFPage+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F37322B1292DF9410013862C /* CPDFPage+PDFListView.m */; };
-		F37322DC292DF9410013862C /* CPDFPage+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F37322B1292DF9410013862C /* CPDFPage+PDFListView.m */; };
-		F37322DD292DF9410013862C /* CPDFPage+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F37322B1292DF9410013862C /* CPDFPage+PDFListView.m */; };
 		F37322DE292DF9410013862C /* CPDFFreeTextAnnotation+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F37322B4292DF9410013862C /* CPDFFreeTextAnnotation+PDFListView.m */; };
 		F37322DF292DF9410013862C /* CPDFFreeTextAnnotation+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F37322B4292DF9410013862C /* CPDFFreeTextAnnotation+PDFListView.m */; };
 		F37322E0292DF9410013862C /* CPDFFreeTextAnnotation+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F37322B4292DF9410013862C /* CPDFFreeTextAnnotation+PDFListView.m */; };
@@ -4855,8 +4852,6 @@
 		F36EB6C82987C9FE004C25FB /* KMDocumentAIViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMDocumentAIViewController.xib; sourceTree = "<group>"; };
 		F3732284292CB1150013862C /* NSEvent+PDFListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSEvent+PDFListView.h"; sourceTree = "<group>"; };
 		F3732288292CB4030013862C /* CPDFListView+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CPDFListView+Private.h"; sourceTree = "<group>"; };
-		F37322B0292DF9410013862C /* CPDFPage+PDFListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CPDFPage+PDFListView.h"; sourceTree = "<group>"; };
-		F37322B1292DF9410013862C /* CPDFPage+PDFListView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CPDFPage+PDFListView.m"; sourceTree = "<group>"; };
 		F37322B3292DF9410013862C /* CPDFRedactAnnotation+PDFListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CPDFRedactAnnotation+PDFListView.h"; sourceTree = "<group>"; };
 		F37322B4292DF9410013862C /* CPDFFreeTextAnnotation+PDFListView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CPDFFreeTextAnnotation+PDFListView.m"; sourceTree = "<group>"; };
 		F37322B5292DF9410013862C /* CPDFWidgetAnnotation+PDFListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CPDFWidgetAnnotation+PDFListView.h"; sourceTree = "<group>"; };
@@ -9203,8 +9198,6 @@
 		F37322AF292DF9410013862C /* CPDFPageExtensions */ = {
 			isa = PBXGroup;
 			children = (
-				F37322B0292DF9410013862C /* CPDFPage+PDFListView.h */,
-				F37322B1292DF9410013862C /* CPDFPage+PDFListView.m */,
 				BB31981D2AC57ACA00107371 /* CPDFPage+PDFListView.swift */,
 			);
 			path = CPDFPageExtensions;
@@ -11158,7 +11151,6 @@
 				F34BF93F29530D02002C25A2 /* NSBezierPath+PDFListView.m in Sources */,
 				AD9527EA2955520C0039D2BC /* KMBaseTextFieldModel.swift in Sources */,
 				BB146FEA299DC0D100784A6A /* GTLRDuration.m in Sources */,
-				F37322DB292DF9410013862C /* CPDFPage+PDFListView.m in Sources */,
 				BB146FFC299DC0D100784A6A /* OIDAuthState+Mac.m in Sources */,
 				BB31981E2AC57ACA00107371 /* CPDFPage+PDFListView.swift in Sources */,
 				9F705F89291E576D005199AD /* KMTableView.swift in Sources */,
@@ -11893,7 +11885,6 @@
 				BB2EDF7A296ECE17003BCF58 /* KMPageEditThumbnailItem.swift in Sources */,
 				89E4E6FC2963D341002DBA6F /* KMPopUpButton.m in Sources */,
 				9FBA0EF628FFC8A0001117AF /* KMCollectionView.swift in Sources */,
-				F37322DC292DF9410013862C /* CPDFPage+PDFListView.m in Sources */,
 				ADD1B7072946CBB600C3FFF7 /* KMBaseTextFormatter.swift in Sources */,
 				BB8F4573295ACE380037EA22 /* KMHeaderFooterAdjectiveListCell.swift in Sources */,
 				BBD54ED52A1CBD720012A230 /* NSView+KMExtension.swift in Sources */,
@@ -12433,7 +12424,6 @@
 				9FDD0FB9295D5230000C4DAD /* KMToolbarController.swift in Sources */,
 				ADE614AE29779C5200F62ED7 /* KMImageTitleButton.swift in Sources */,
 				9F1F82F0293609F60092C4B4 /* CPDFDocument+PageEditManager.swift in Sources */,
-				F37322DD292DF9410013862C /* CPDFPage+PDFListView.m in Sources */,
 				F3B7DFAB294C545B00333201 /* NSPopover+PDFListView.m in Sources */,
 				BB89722B294B08720045787C /* KMWatermarkAdjectiveTopBarItemModel.swift in Sources */,
 				BB14700A299DC0D100784A6A /* OIDRegistrationRequest.m in Sources */,

+ 2 - 2
PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -30,8 +30,8 @@
             filePath = "PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "326"
-            endingLineNumber = "326"
+            startingLineNumber = "325"
+            endingLineNumber = "325"
             landmarkName = "-addAnnotationWithType:selection:page:bounds:"
             landmarkType = "7">
          </BreakpointContent>

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/Crop/Controller/KMCropPreviewController.swift

@@ -309,7 +309,7 @@ class KMCropPreviewController: KMWatermarkAdjectivePreViewBaseController {
                     if (pageSize.width == 0 && pageSize.height == 0) {
                         
                     } else {
-                        let tiffData = page.pdfListViewTIFFData(for: rect)
+                        let tiffData = page.PDFListViewTIFFData(for: rect)
                         let index: UInt = (page.pageIndex())
 //                        let newPage: CPDFPage = CPDFPage(image: NSImage(data: tiffData!))
                         
@@ -480,7 +480,7 @@ class KMCropPreviewController: KMWatermarkAdjectivePreViewBaseController {
             rect = getPageForegroundBox(page!)
         }
         
-        let tiffData = page!.pdfListViewTIFFData(for: rect)
+        let tiffData = page!.PDFListViewTIFFData(for: rect)
         
         let index: UInt = (page?.pageIndex())!
         

+ 0 - 29
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFPageExtensions/CPDFPage+PDFListView.h

@@ -1,29 +0,0 @@
-//
-//  CPDFPage+PDFListView.h
-//  ComPDFKit
-//
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <ComPDFKit/ComPDFKit.h>
-
-@interface CPDFPage (PDFListView)
-
-- (NSData *)PDFListViewTIFFDataForRect:(NSRect)rect;
-
-@end
-
-@interface CPDFPage (KMExtension)
-
-- (void)leftRotate;
-- (void)rightRotate;
-
-- (BOOL)isHorizontal;
-- (BOOL)isVertical;
-
-@end

+ 0 - 164
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFPageExtensions/CPDFPage+PDFListView.m

@@ -1,164 +0,0 @@
-//
-//  CPDFPage+PDFListView.m
-//  ComPDFKit
-//
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFPage+PDFListView.h"
-#import "NSShadow+PDFListView.h"
-#import "NSGeometry+PDFListView.h"
-
-@implementation CPDFPage (PDFListView)
-
-- (NSData *)PDFListViewTIFFDataForRect:(NSRect)rect {
-    CPDFDisplayBox box = NSEqualRects(rect, [self boundsForBox:CPDFDisplayCropBox]) ? CPDFDisplayCropBox : CPDFDisplayMediaBox;
-    NSImage *pageImage = [self PDFListViewThumbnailWithSize:0.0 forBox:box shadowBlurRadius:0.0];
-    NSRect bounds = self.bounds;
-    
-    if (NSEqualRects(rect, NSZeroRect) || NSEqualRects(rect, bounds))
-        return [pageImage TIFFRepresentation];
-    if (NSIsEmptyRect(rect))
-        return nil;
-    
-    NSAffineTransform *transform = [self PDFListViewAffineTransformForBox:box];
-    NSRect sourceRect = CPDFListViewRectFromPoints([transform transformPoint:CPDFListViewBottomLeftPoint(rect)], [transform transformPoint:CPDFListViewTopRightPoint(rect)]);
-    NSRect destRect = sourceRect;
-    destRect.origin = NSZeroPoint;
-    
-    NSImage *image = [[NSImage alloc] initWithSize:destRect.size];
-    [image lockFocus];
-    [pageImage drawInRect:destRect fromRect:sourceRect operation:NSCompositingOperationCopy fraction:1.0];
-    [image unlockFocus];
-    
-    return [image TIFFRepresentation];
-}
-
-- (NSAffineTransform *)PDFListViewAffineTransformForBox:(CPDFDisplayBox)box {
-    NSRect bounds = self.bounds;
-    NSAffineTransform *transform = [NSAffineTransform transform];
-    [transform rotateByDegrees:-[self rotation]];
-    switch ([self rotation]) {
-        case 0:   [transform translateXBy:-NSMinX(bounds) yBy:-NSMinY(bounds)]; break;
-        case 90:  [transform translateXBy:-NSMaxX(bounds) yBy:-NSMinY(bounds)]; break;
-        case 180: [transform translateXBy:-NSMaxX(bounds) yBy:-NSMaxY(bounds)]; break;
-        case 270: [transform translateXBy:-NSMinX(bounds) yBy:-NSMaxY(bounds)]; break;
-    }
-    return transform;
-}
-
-- (NSImage *)PDFListViewThumbnailWithSize:(CGFloat)aSize forBox:(CPDFDisplayBox)box shadowBlurRadius:(CGFloat)shadowBlurRadius {
-    NSRect bounds = [self boundsForBox:box];
-    NSSize pageSize = bounds.size;
-    CGFloat scale = 1.0;
-    NSSize thumbnailSize;
-    CGFloat shadowOffset = shadowBlurRadius > 0.0 ? - ceil(shadowBlurRadius * 0.75) : 0.0;
-    NSRect pageRect = NSZeroRect;
-    NSImage *image;
-    
-    if ([self rotation] % 180 == 90)
-        pageSize = NSMakeSize(pageSize.height, pageSize.width);
-    
-    if (aSize > 0.0) {
-        if (pageSize.height > pageSize.width)
-            thumbnailSize = NSMakeSize(round((aSize - 2.0 * shadowBlurRadius) * pageSize.width / pageSize.height + 2.0 * shadowBlurRadius), aSize);
-        else
-            thumbnailSize = NSMakeSize(aSize, round((aSize - 2.0 * shadowBlurRadius) * pageSize.height / pageSize.width + 2.0 * shadowBlurRadius));
-        scale = fmax((thumbnailSize.width - 2.0 * shadowBlurRadius) / pageSize.width, (thumbnailSize.height - 2.0 * shadowBlurRadius) / pageSize.height);
-    } else {
-        thumbnailSize = NSMakeSize(pageSize.width + 2.0 * shadowBlurRadius, pageSize.height + 2.0 * shadowBlurRadius);
-    }
-    
-    pageRect.size = thumbnailSize;
-    
-    if (shadowBlurRadius > 0.0) {
-        pageRect = NSInsetRect(pageRect, shadowBlurRadius, shadowBlurRadius);
-        pageRect.origin.y -= shadowOffset;
-    }
-    if (isnan(thumbnailSize.width) || isnan(thumbnailSize.height)) {
-        image = [[NSImage alloc] initWithSize:CGSizeMake(186.0, 256.0)];
-    } else {
-        image = [[NSImage alloc] initWithSize:thumbnailSize];
-    }
-    
-    [image lockFocus];
-    
-    CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
-
-    [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationHigh];
-    
-    [NSGraphicsContext saveGraphicsState];
-    [[NSColor whiteColor] setFill];
-    if (shadowBlurRadius > 0.0)
-        [NSShadow setPDFListViewShadowWithColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.5] blurRadius:shadowBlurRadius yOffset:shadowOffset];
-    NSRectFill(pageRect);
-    [NSGraphicsContext restoreGraphicsState];
-    
-    if (fabs(scale - 1.0) > 0.0 || shadowBlurRadius > 0.0) {
-        NSAffineTransform *transform = [NSAffineTransform transform];
-        if (shadowBlurRadius > 0.0)
-            [transform translateXBy:NSMinX(pageRect) yBy:NSMinY(pageRect)];
-        [transform scaleBy:scale];
-        [transform concat];
-    }
-    
-//    [self drawWithBox:box toContext:context];
-    [self drawEditWithBox:box toContext:context];
-    
-    [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationDefault];
-    
-    [image unlockFocus];
-    
-    return image;
-}
-
-@end
-
-@implementation CPDFPage (KMExtension)
-
-- (void)leftRotate {
-    NSInteger rotation = self.rotation % 360;
-    
-    if (rotation == 0) {
-        self.rotation = 270;
-    } else if (rotation == 90) {
-        self.rotation = 0;
-    } else if (rotation == 180) {
-        self.rotation = 90;
-    } else if (rotation == 270) {
-        self.rotation = 180;
-    }
-}
-
-- (void)rightRotate {
-    NSInteger rotation = self.rotation % 360;
-    
-    if (rotation == 0) {
-        self.rotation = 90;
-    } else if (rotation == 90) {
-        self.rotation = 180;
-    } else if (rotation == 180) {
-        self.rotation = 270;
-    } else if (rotation == 270) {
-        self.rotation = 0;
-    }
-}
-
-- (BOOL)isHorizontal {
-    NSInteger rotation = self.rotation % 360;
-    
-    return labs(rotation) == 90 || labs(self.rotation) == 270;
-}
-
-- (BOOL)isVertical {
-    NSInteger rotation = self.rotation % 360;
-    
-    return rotation == 0 || labs(rotation) == 180;
-}
-
-@end

+ 75 - 83
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFPageExtensions/CPDFPage+PDFListView.swift

@@ -7,11 +7,84 @@
 
 import Foundation
 
+@objc extension CPDFPage {
+    @objc func PDFListViewTIFFData(for rect: NSRect) -> Data? {
+        if (NSIsEmptyRect(rect)) {
+            return nil
+        }
+        
+        let box: CPDFDisplayBox = NSEqualRects(rect, self.bounds(for: .cropBox)) ? .cropBox : .mediaBox
+        let pageImage = self._PDFListViewThumbnailWithSize(0.0, forBox: box, shadowBlurRadius: 0.0)
+        let bounds = self.bounds
+        
+        if (NSEqualRects(rect, NSZeroRect) || NSEqualRects(rect, bounds)) {
+            return pageImage?.tiffRepresentation
+        }
+        
+        let transform = self._PDFListViewAffineTransformForBox(box: box)
+        let sourceRect = CPDFListViewRectFromPoints(transform.transform(CPDFListViewBottomLeftPoint(rect)), transform.transform(CPDFListViewTopRightPoint(rect)))
+        var destRect = sourceRect
+        destRect.origin = NSZeroPoint
+        
+        let image = NSImage(size: destRect.size)
+        image.lockFocus()
+        pageImage?.draw(in: destRect, from: sourceRect, operation: .copy, fraction: 1.0)
+        image.unlockFocus()
+        
+        return image.tiffRepresentation
+    }
+}
+
+// MARK: - KMExtension
+
 extension CPDFPage {
+    func leftRotate() {
+        let rotation = self.rotation % 360
+        
+        if (rotation == 0) {
+            self.rotation = 270
+        } else if (rotation == 90) {
+            self.rotation = 0
+        } else if (rotation == 180) {
+            self.rotation = 90
+        } else if (rotation == 270) {
+            self.rotation = 180
+        }
+    }
+    
+    func rightRotate() {
+        let rotation = self.rotation % 360
+        
+        if (rotation == 0) {
+            self.rotation = 90
+        } else if (rotation == 90) {
+            self.rotation = 180
+        } else if (rotation == 180) {
+            self.rotation = 270
+        } else if (rotation == 270) {
+            self.rotation = 0
+        }
+    }
+    
+    func isHorizontal() -> Bool {
+        let rotation = self.rotation % 360
+        
+        return labs(rotation) == 90 || labs(self.rotation) == 270
+    }
     
+    func isVertical() -> Bool {
+        let rotation = self.rotation % 360
+        
+        return rotation == 0 || labs(rotation) == 180
+    }
+}
+
+// MARK: - Private Methods
+
+extension CPDFPage {
     private func _PDFListViewAffineTransformForBox(box: CPDFDisplayBox) -> NSAffineTransform {
-        var bounds = self.bounds
-        var transform = NSAffineTransform()
+        let bounds = self.bounds
+        let transform = NSAffineTransform()
         transform.rotate(byDegrees: -CGFloat(self.rotation))
         switch self.rotation {
         case 0:
@@ -91,85 +164,4 @@ extension CPDFPage {
         
         return image
     }
-    
-//    func PDFListViewTIFFDataForRect
-    
 }
-
-/*
- 
-
- - (NSData *)PDFListViewTIFFDataForRect:(NSRect)rect {
-     CPDFDisplayBox box = NSEqualRects(rect, [self boundsForBox:CPDFDisplayCropBox]) ? CPDFDisplayCropBox : CPDFDisplayMediaBox;
-     NSImage *pageImage = [self PDFListViewThumbnailWithSize:0.0 forBox:box shadowBlurRadius:0.0];
-     NSRect bounds = self.bounds;
-     
-     if (NSEqualRects(rect, NSZeroRect) || NSEqualRects(rect, bounds))
-         return [pageImage TIFFRepresentation];
-     if (NSIsEmptyRect(rect))
-         return nil;
-     
-     NSAffineTransform *transform = [self PDFListViewAffineTransformForBox:box];
-     NSRect sourceRect = CPDFListViewRectFromPoints([transform transformPoint:CPDFListViewBottomLeftPoint(rect)], [transform transformPoint:CPDFListViewTopRightPoint(rect)]);
-     NSRect destRect = sourceRect;
-     destRect.origin = NSZeroPoint;
-     
-     NSImage *image = [[NSImage alloc] initWithSize:destRect.size];
-     [image lockFocus];
-     [pageImage drawInRect:destRect fromRect:sourceRect operation:NSCompositingOperationCopy fraction:1.0];
-     [image unlockFocus];
-     
-     return [image TIFFRepresentation];
- }
-
-
-
- 
-
- @end
-
- @implementation CPDFPage (KMExtension)
-
- - (void)leftRotate {
-     NSInteger rotation = self.rotation % 360;
-     
-     if (rotation == 0) {
-         self.rotation = 270;
-     } else if (rotation == 90) {
-         self.rotation = 0;
-     } else if (rotation == 180) {
-         self.rotation = 90;
-     } else if (rotation == 270) {
-         self.rotation = 180;
-     }
- }
-
- - (void)rightRotate {
-     NSInteger rotation = self.rotation % 360;
-     
-     if (rotation == 0) {
-         self.rotation = 90;
-     } else if (rotation == 90) {
-         self.rotation = 180;
-     } else if (rotation == 180) {
-         self.rotation = 270;
-     } else if (rotation == 270) {
-         self.rotation = 0;
-     }
- }
-
- - (BOOL)isHorizontal {
-     NSInteger rotation = self.rotation % 360;
-     
-     return labs(rotation) == 90 || labs(self.rotation) == 270;
- }
-
- - (BOOL)isVertical {
-     NSInteger rotation = self.rotation % 360;
-     
-     return rotation == 0 || labs(rotation) == 180;
- }
-
- @end
-
- */

+ 0 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m

@@ -23,7 +23,6 @@
 #import "CPDFListView+Event.h"
 #import "CPDFListView+Tool.h"
 #import "CPDFAnnotation+PDFListView.h"
-#import "CPDFPage+PDFListView.h"
 #import "CPDFListView+Extension.h"
 #import "CPDFListView+UndoManager.h"
 #import "NSString+PDFListView.h"

+ 1 - 6
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -14,7 +14,6 @@
 
 #import "CPDFListView+Private.h"
 #import "CPDFListView+Tool.h"
-#import "CPDFPage+PDFListView.h"
 
 #import "NSEvent+PDFListView.h"
 #import "NSImage+PDFListView.h"
@@ -38,11 +37,7 @@
 #import "NSPopover+PDFListView.h"
 #import "CPDFListSignatureAnnotation.h"
 
-#if VERSION_DMG
 #import <PDF_Master-Swift.h>
-#else
-#import <PDF_Master-Swift.h>
-#endif
 
 #define DEFAULT_MAGNIFICATION 2.5
 #define SMALL_MAGNIFICATION   1.5
@@ -3234,7 +3229,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
     if (CSelectToolMode == self.toolMode && NSIsEmptyRect(self.selectionRect) == NO && self.selectionPageIndex != NSNotFound) {
         NSRect selRect = NSIntegralRect(self.selectionRect);
         CPDFPage *page = [self currentSelectionPage];
-        NSData *tiffData = [page PDFListViewTIFFDataForRect:selRect];
+        NSData *tiffData = [page PDFListViewTIFFDataFor:selRect];
         
         imageItem = [[NSPasteboardItem alloc] init];
         

+ 0 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Tool.m

@@ -13,7 +13,6 @@
 #import "CPDFListView+Tool.h"
 
 #import "CPDFListView+Private.h"
-#import "CPDFPage+PDFListView.h"
 #import "CPDFListHoverAnnotationViewController.h"
 #import "CPDFAnnotation+PDFListView.h"
 #import "NSCursor+PDFListView.h"

+ 0 - 1
PDF Office/PDF Master/PDF_Master DMG-Bridging-Header.h

@@ -27,7 +27,6 @@
 
 #import "CPDFListView+Tool.h"
 #import "NSBitmapImageRep_SKExtensions.h"
-#import "CPDFPage+PDFListView.h"
 #import "KMPopUpButton.h"
 #import <Masonry/Masonry.h>
 #import "TextFieldFormatter.h"

+ 0 - 1
PDF Office/PDF Master/PDF_Master Pro-Bridging-Header.h

@@ -15,7 +15,6 @@
 
 #import "CPDFListView+Tool.h"
 #import "NSBitmapImageRep_SKExtensions.h"
-#import "CPDFPage+PDFListView.h"
 #import "CPDFListView+Public.h"
 #import "KMGeneralAnnotationViewController.h"
 #import "KMAnnotationPropertiesViewController.h"

+ 1 - 1
PDF Office/PDF Master/PDF_Master-Bridging-Header.h

@@ -28,7 +28,6 @@
 
 #import "CPDFListView+Tool.h"
 #import "NSBitmapImageRep_SKExtensions.h"
-#import "CPDFPage+PDFListView.h"
 #import "KMPopUpButton.h"
 #import <Masonry/Masonry.h>
 #import "TextFieldFormatter.h"
@@ -72,3 +71,4 @@
 #import "KMSignatureHelpViewController.h"
 
 #import "NSShadow+PDFListView.h"
+#import "NSGeometry+PDFListView.h"