* engine's documentation for available config options.
* @return an NSData object containing raw PDF data.
*/
public static NSData htmlAsPdf(String html, String encoding, String urlPrefix, NSDictionary<String, Object> config) {
NSMutableDictionary<String, Object> _config = config == null ? new NSMutableDictionary<String, Object>() : config.mutableClone();
PDFBuilder builder = PDFBuilderFactory.newBuilder((String) _config.removeObjectForKey("engine"));
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
builder.setSource(html, encoding, urlPrefix, _config);
builder.createDocument(os);
os.close();
return new NSData(os.toByteArray());
} catch (Exception e) {
throw com.webobjects.foundation.NSForwardException._runtimeExceptionForThrowable(e);
}