2 Replies Latest reply on Apr 7, 2014 5:48 AM by Zoze

    Html2Canvas

    Zoze Level 1

      Hi,

       

      I am trying to make image with html2canvas.

       

      I have to elements and I want to combine them to a single image.

       

      With

       

      html2canvas($('.background'), {

         onrendered: function(canvas) {

           var img = canvas.toDataURL()

         

      {

       

       

      html2canvas($('.layers'), {

         onrendered: function(canvas) {

           var img = canvas.toDataURL()

           window.open(img);

          }

          }

          )}}})

       

      create only image for class layers and not the background.

       

      If have them both with the same class name then again it renders only the one element.

       

      Does someone Know something?

       

      For reference: https://www.dropbox.com/s/np5u3ibzml52e6f/html2canvas.rar

       

       

      Thanks!

        • 1. Re: Html2Canvas
          hemanthR Adobe Employee

          If i understand you right you need to getenrate image of  only elements with class name 'layers'.

          For that this snippet will work rit?

          html2canvas($('.layers'), {

                          onrendered: function (canvas) {

                              var img = canvas.toDataURL()

                              window.open(img);

                          }

                      });

          1 person found this helpful
          • 2. Re: Html2Canvas
            Zoze Level 1

            Hi,

             

            I want to create image from two elements, background and layers.