diff --git a/build.xml b/build.xml
index 9376385..a0e5da7 100644
--- a/build.xml
+++ b/build.xml
@@ -23,6 +23,7 @@
+
@@ -76,6 +77,7 @@
+
diff --git a/src/Renderer.js b/src/Renderer.js
index 3513391..834767e 100644
--- a/src/Renderer.js
+++ b/src/Renderer.js
@@ -58,9 +58,9 @@ _html2canvas.Renderer = function(parseQueue, options){
sortZ(parseQueue.zIndex);
- if ( typeof options.renderer._create !== "function" ) {
+ if ( typeof options._renderer._create !== "function" ) {
throw new Error("Invalid renderer defined");
}
- return options.renderer._create( parseQueue, options, document, queue, _html2canvas );
+ return options._renderer._create( parseQueue, options, document, queue, _html2canvas );
};
diff --git a/src/Util.js b/src/Util.js
index 9934691..ddd394d 100644
--- a/src/Util.js
+++ b/src/Util.js
@@ -34,14 +34,20 @@ html2canvas = function( elements, opts ) {
flashcanvas: undefined, // path to flashcanvas
width: null,
height: null,
- taintTest: true // do a taint test with all images before applying to canvas
-
- };
+ taintTest: true, // do a taint test with all images before applying to canvas
+ renderer: "Canvas"
+ }, renderer;
options = _html2canvas.Util.Extend(opts, options);
-
- options.renderer = options.renderer || _html2canvas.Renderer.Canvas( options );
-
+
+ if (typeof options.renderer === "string" && _html2canvas.Renderer[options.renderer] !== undefined) {
+ options._renderer = _html2canvas.Renderer[options.renderer]( options );
+ } else if (typeof options.renderer === "function") {
+ options._renderer = _html2canvas.Renderer.Canvas( options );
+ } else {
+ throw("Unknown renderer");
+ }
+
_html2canvas.logging = options.logging;
options.complete = function( images ) {