 import Foundation
 import UIKit
 
-
+/**
+ PDFPage type
+ 
+ - WhitePage: A white view (CGSize).
+ - View:      A view. (UIView)
+ - Image:     An image (UIImage)
+ - ImagePath: An image path (String)
+ */
 public enum PDFPage {
     case WhitePage(CGSize)
     case View(UIView)

        return try outputToData { try renderPages(pages) }
    }

    @warn_unused_result
    public class func generate(view: UIView) throws -> NSData {
        return try generate([view])
    }

    @warn_unused_result
    public class func generate(views: [UIView]) throws -> NSData  {
        return try generate(PDFPage.pages(views))
    }
    
    @warn_unused_result
    public class func generate(image: UIImage) throws -> NSData {
        return try generate([image])
    }

    @warn_unused_result
    public class func generate(images: [UIImage]) throws -> NSData {
        return try generate(PDFPage.pages(images))
    }
    
    @warn_unused_result
    public class func generate(imagePath: String) throws -> NSData {
        return try generate([imagePath])
    }
    
    @warn_unused_result
    public class func generate(imagePaths: [String]) throws -> NSData {
        return try generate(PDFPage.pages(imagePaths))
    }
}

private extension PDFGenerator {
    class func renderPage(page: PDFPage) throws {
        switch page {

    }
}


/**
 PDFGenerateError
 
 - ZeroSizeView:    View's size is (0, 0)
 - ImageLoadFailed: Image has not been loaded from image path.
 - EmptyOutputPath: Output path is empty.
 - EmptyPage:       Create PDF from no pages.
 */
public enum PDFGenerateError: ErrorType {
    case ZeroSizeView(UIView)
    case ImageLoadFailed(String)
