1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- import Foundation
- import UIKit
- public enum PDFPage {
-
- case whitePage(CGSize)
-
- case view(UIView)
-
- case image(UIImage)
-
- case imagePath(String)
-
- case binary(Data)
-
- case imageRef(CGImage)
-
-
- static func pages(_ views: [UIView]) -> [PDFPage] {
- return views.map { .view($0) }
- }
-
-
- static func pages(_ images: [UIImage]) -> [PDFPage] {
- return images.map { .image($0) }
- }
-
-
- static func pages(_ imagePaths: [String]) -> [PDFPage] {
- return imagePaths.map { .imagePath($0) }
- }
- }
- public struct PDFPageSize {
- fileprivate init() {}
-
- public static let A4 = CGSize(width: 595.0, height: 842.0)
-
- public static let B5 = CGSize(width: 516.0, height: 729.0)
- }
|