PDFGenerateError.swift 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // PDFGenerateError.swift
  3. // PDFGenerator
  4. //
  5. // Created by Suguru Kishimoto on 2016/06/21.
  6. //
  7. //
  8. import Foundation
  9. /**
  10. PDFGenerateError
  11. - ZeroSizeView: View's size is (0, 0)
  12. - ImageLoadFailed: Image has not been loaded from image path.
  13. - EmptyOutputPath: Output path is empty.
  14. - EmptyPage: Create PDF from no pages.
  15. - InvalidContext: If UIGraphicsGetCurrentContext returns nil.
  16. - InvalidPassword: If password cannot covert ASCII text.
  17. - TooLongPassword: If password too long
  18. */
  19. public enum PDFGenerateError: Error {
  20. /// View's size is (0, 0)
  21. case zeroSizeView(UIView)
  22. /// Image has not been loaded from image path.
  23. case imageLoadFailed(Any)
  24. /// Output path is empty
  25. case emptyOutputPath
  26. /// Attempt to create empty PDF. (no pages.)
  27. case emptyPage
  28. /// If UIGraphicsGetCurrentContext returns nil.
  29. case invalidContext
  30. /// If rendering scale factor is zero.
  31. case invalidScaleFactor
  32. /// If password cannot covert ASCII text.
  33. case invalidPassword(String)
  34. /// If password too long
  35. case tooLongPassword(Int)
  36. }