             }
         }
     }
+    
+    func testPDFSurface() {
+        
+        let testName = "testPDFSurface"
+        
+        func fileName(for size: Int) -> String {
+            
+            return outputDirectory + "\(testName)_\(size).pdf"
+        }
+        
+        testDraw(createSurface:{ try! Surface.PDF(filename: fileName(for: $0), width: Double($0), height: Double($0)) }) { (surface) in
+            
+            surface.flush()
+            surface.finish()
+            
+            
+            
+            print("Wrote \(#function) test to \(testFilename)")
+        }
+    }
 }
 
 fileprivate extension Context {

            
            for size in sizes {
                
                let testFilename = outputDirectory + "\(testName)_\(format)_\(size).png"
                
                let surface = try! Surface.Image(format: format, width: size, height: size)
                
                let context = Cairo.Context(surface: surface)
                
                context.drawSourceX(size: size)
                
                surface.writePNG(atPath: testFilename)
                

        try! FileManager.default.createDirectory(atPath: outputDirectory, withIntermediateDirectories: false)
    }
    
    // remove all files in directory (previous test cache)
    let contents = try! FileManager.default.contentsOfDirectory(atPath: outputDirectory)
    
    contents.forEach { try! FileManager.default.removeItem(atPath: outputDirectory + $0) }
