123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- //
- // KMPDFWatermarkData.swift
- // PDF Reader Pro
- //
- // Created by tangchao on 2023/11/2.
- //
- import Cocoa
- enum WatermarkPageRangeType: Int {
- case all = 0
- case odd
- case even
- case other
- }
- @objcMembers class KMPDFWatermarkData: NSObject {
- var text: String = NSLocalizedString("Watermark", comment: "")
- var image: NSImage?
- var imagePath: String?
-
- var textFontSize: CGFloat = 48
- var textColor: NSColor = NSColor.red
-
- var rotation: Int = 0
- var opacity: CGFloat = 1
-
- var scale: CGFloat = 1
-
- // (Top:0 Middle:1 Bottom:2)
- var verticalMode: Int = 1
- var verticalSpace: Int = 0
- // (Left:0 Middle:1 Right:2)
- var horizontalMode: Int = 1
- var horizontalSpace: Int = 0
-
- var tileHorizontalSpace: Int = 100
- var tileVerticalSpace: Int = 100
- var pagesString: String = ""
-
- var isFront: Bool = true
- var isTilePage = false
-
- var tag: String?
-
- var pageRangeType: WatermarkPageRangeType = .all
-
- var creatTemplateDate: String?
-
- var watermark: CPDFWatermark?
- var watermarkID: String = KMWatermarkManager.defaultManager.fetchAvailableName()
-
-
- override func copy() -> Any {
- let watermark = KMPDFWatermarkData()
- watermark.text = self.text
- watermark.image = self.image
- watermark.textFontSize = self.textFontSize
- watermark.textColor = self.textColor
- watermark.rotation = self.rotation
- watermark.opacity = self.opacity
- watermark.scale = self.scale
- watermark.verticalMode = self.verticalMode
- watermark.verticalSpace = self.verticalSpace
- watermark.horizontalMode = self.horizontalMode
- watermark.horizontalSpace = self.horizontalSpace
- watermark.pagesString = self.pagesString
- watermark.isFront = self.isFront
- watermark.watermarkID = self.watermarkID
- watermark.tag = self.tag
- watermark.pageRangeType = self.pageRangeType
- watermark.imagePath = self.imagePath
- watermark.tileVerticalSpace = self.tileVerticalSpace
- watermark.tileHorizontalSpace = self.tileHorizontalSpace
- watermark.isTilePage = self.isTilePage
- return watermark
- }
- }
|