Add lead workflows, PDF signing, AR projects and photo gallery integration
This commit is contained in:
26
GasTankAR/Services/Signing/PDFSigningService.swift
Normal file
26
GasTankAR/Services/Signing/PDFSigningService.swift
Normal file
@ -0,0 +1,26 @@
|
||||
import Foundation
|
||||
import PencilKit
|
||||
|
||||
/// Coordinates are PDF points, measured from the bottom-left of the media box.
|
||||
struct PDFSignaturePlacement: Equatable, Sendable {
|
||||
let pageIndex: Int
|
||||
let bounds: CGRect
|
||||
}
|
||||
|
||||
@MainActor
|
||||
protocol PDFSigningService {
|
||||
func sign(source: URL, drawing: PKDrawing, placement: PDFSignaturePlacement) async throws -> URL
|
||||
}
|
||||
|
||||
enum PDFSigningError: LocalizedError {
|
||||
case invalidDocument, emptySignature, invalidPlacement, saveFailed
|
||||
|
||||
var errorDescription: String? {
|
||||
switch self {
|
||||
case .invalidDocument: "Die PDF konnte nicht gelesen werden."
|
||||
case .emptySignature: "Bitte zuerst unterschreiben."
|
||||
case .invalidPlacement: "Für dieses Dokument fehlt eine gültige Unterschriftsposition."
|
||||
case .saveFailed: "Die unterschriebene PDF konnte nicht gespeichert werden."
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user