Open lokomass opened 1 year ago
👋 @lokomass
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Hello,
try this.
const filter = (node) =>{ const exclude = ['add-button'] return (!exclude.some(classname => node.classList.contains(classname))) }
Yes it works ! Secondly, I want to replace a node (background of the node) without any visible change on HTML page. I've try this but its not work.
const Filter = (node) => {
return(
(node.classList)
? node.classList.contains('add-button')
? null
: node.classList.contains('appointment-selected')
? node.cloneNode(true).style.removeProperty('background-color') //here I want remove property backgroundColor on clone's node, and return it...
: node
: node
)
}
...
htmlToImage.toJpeg(input, {
filter: Filter,
}).then(function(data) {
...
})
Do you have an idea please ?
Thanks a lots
any idea ? thx
Does anybody can help me please ?
Hi,
I'm trying to exclude a div from my component before converting in jpeg.
const filter = (node) =>{ const exclude = ['add-button'] return (!exclude.some(classname => node.classList.includes(classname))) }
And my export :
const input = document.getElementById('scheduler').firstElementChild.lastElementChild htmlToImage.toJpeg(input, { filter: filter, backgroundColor: '#fff' }).then(function(data) { ...
I have the error :
Uncaught (in promise) TypeError: node.classList.includes is not a function
Thanks for helping