Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

298
Views
How to use dataURL to save div image With drop-shadow outline? (codepen link in cmt)

I want to use toDataURL to download specific div image

 <div class="webtoonImage">
    </div> <!--side display webtoon-->

But because my div have filter drop-shadow as an outline border. So that why the toDataURL didn't capture it.

.container {
  display: grid;
  filter: drop-shadow(1px 0px 0px black) 
    drop-shadow(-1px 0px 0px black)
    drop-shadow(0px 1px 0px black) 
    drop-shadow(0px -1px 0px black)
    drop-shadow(1px 1px 0px black);
}

I was wonder is it possible to save the image with the drop-shadow outline border?

Here is the video link of the problems: video link demonstate problem

Explain problme in image form: When I click download button: clicking download button

This is how the image div is downloaded download image no border

There is no border outline , the dataURL didn't capture the drop-shadow outline border downlaod image no border outline quesiton mark

The drop-shadow is at the .container class width drop-shadow outline clip path balloon

This is when I turn off the drop-shadow no drop-shadow

Here is the toDataURL function to donwload the .div .webtoonImage:

function downloadWebtoonDesktop() {
    html2canvas(document.querySelector(".webtoonImage")).then(function(canvas) {
        // document.body.appendChild(canvas);
        console.log("hello")
        var dataURL = canvas.toDataURL("image/png");
        let downloadLink = document.createElement('a');
      downloadLink.setAttribute('download', 'DiamondWebtoonLayout-Episode-.png');
      let url = dataURL.replace(/^data:image\/png/,'data:application/octet-stream');
      downloadLink.setAttribute('href', url);
      downloadLink.click();
        // document.querySelector("#theimage9").src = theimage9; 
    });
}

[UNSOLVED] codepen link

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!