config.Rd
Customize configuration of the html2canvas call.
config( allowTaint, backgroundColor, canvas, foreignObjectRendering, imageTimeout, ignoreElements, logging, onclone, proxy, removeContainer, useCORS, scale, width, height, x, y, scrollX, scrollY, windowWidth, windowHeight, ... )
allowTaint | Whether to allow cross-origin images to taint the canvas. Default = FALSE |
---|---|
backgroundColor | Canvas background color, if none is specified in DOM. Set NULL for transparent. Default: '#ffffff' |
canvas | Existing canvas element to use as a base for drawing on. Default = NULL |
foreignObjectRendering | Whether to use ForeignObject rendering if the browser supports it. Default = FALSE |
imageTimeout | Timeout for loading an image (in milliseconds). Set to 0 to disable timeout. Default: 15000 |
ignoreElements | Predicate function which removes the matching elements from the render. Usage: '(element) => false' |
logging | Enable logging for debug purposes. Default = TRUE |
onclone | Callback function which is called when the Document has been cloned for rendering, can be used to modify the contents that will be rendered without affecting the original source document. Default = NULL |
proxy | Url to the proxy which is to be used for loading cross-origin images. If left empty, cross-origin images will not be loaded. Default = NULL |
removeContainer | Whether to cleanup the cloned DOM elements html2canvas creates temporarily. Default = TRUE |
useCORS | Whether to attempt to load images from a server using CORS. Default = FALSE |
scale | The scale to use for rendering. Defaults to the browsers device pixel ratio. Default: 'window.devicePixelRatio' |
width | The width of the canvas. Default: Element width |
height | The height of the canvas. Default: Element height |
x | Crop canvas x-coordinate. Default: Element x-offset |
y | Crop canvas y-coordinate. Default: Element y-offset |
scrollX | The x-scroll position to used when rendering element, (for example if the Element uses position: fixed). Default: Element scrollX |
scrollY | The y-scroll position to used when rendering element, (for example if the Element uses position: fixed). Default: Element scrollY |
windowWidth | Window width to use when rendering Element, which may affect things like Media queries. Default: 'window.innerWidth' |
windowHeight | Window height to use when rendering Element, which may affect things like Media queries. Default: 'window.innerHeight' |
... | not used |
json
To find further information on the configurations that can be used please refer to html2canvas