         return backgroundImage!
     }
     
-    class func hasPassword(input: Data) -> Bool {
+    class open func hasPassword(fileURL: URL) -> Bool {
+        return autoreleasepool { () -> Bool in
+            do {
+                let data = try Data(contentsOf: fileURL)
+                return hasPassword(input: data)
+            } catch {
+                return false
+            }
+        }
+    }
+    
+    class open func hasPassword(input: Data) -> Bool {
         return autoreleasepool { () -> Bool in
             let dataProvider = CGDataProvider(data: input as CFData)
             if let provider = dataProvider {

        }
    }
    
    class func canUnlock(fileURL: URL, password: String) -> Bool {
        return autoreleasepool { () -> Bool in
            do {
                let data = try Data(contentsOf: fileURL)
                let dataProvider = CGDataProvider(data: data as CFData)
                let pdf = CGPDFDocument(dataProvider!)
                
                // Try a blank password first, per Apple's Quartz PDF example
                if pdf?.isEncrypted == true &&
                    pdf?.unlockWithPassword("") == false {
                    // Nope, now let's try the provided password to unlock the PDF
                    if let cPasswordString = password.cString(using: String.Encoding.utf8) {
                        if pdf?.unlockWithPassword(cPasswordString) == false {
                            return false
                        }
                    }
                }
                return true
            } catch {
                return false
            }
        }
    }
    
    class func canUnlock(input: Data, password: String) -> Bool {
        return autoreleasepool { () -> Bool in
            let dataProvider = CGDataProvider(data: input as CFData)
            let pdf = CGPDFDocument(dataProvider!)

        }
    }
    
    class open func imageToPDF(image: UIImage, password: String? = nil, scaleFactor: CGFloat = 1) throws -> Data? {
        
        guard scaleFactor > 0.0 else {
            return nil
