title: Exclude element from canvas to be saved to json (fabric.js)
body: <p>I am using </p>
  
  <pre><code> var jsonToPHP= JSON.stringify(canvas.toObject(['id','name']));
  </code></pre>
  
  <p>to save all from canvas to JSON.</p>
  
  <p>I am also adding background image to canvas.</p>
  
  <pre><code>document.getElementById('imgLoader').addEventListener("change", function (e) {   var file = e.target.files[0];   var reader = new FileReader();   reader.onload = function (f) {
      var data = f.target.result;                    
      fabric.Image.fromURL(data, function (img) {
      var oImg = img.set({left: 0, top: 0, angle: 00,width:canvas.width, height:canvas.height,}).scale(1);
      oImg.set('selectable', false);
      canvas.add(oImg).renderAll();
      var dataURL = canvas.toDataURL({format: 'png', quality: 0.8});
      });   };   reader.readAsDataURL(file);
  
  });
  </code></pre>
  
  <p>But i would like to exclude background image to be saved to JASON.</p>
  
  <p>I vas googling for: </p>
  
  <blockquote>
    <p>Exclude element from canvas to be saved to json fabric.js</p>
  </blockquote>
  
  <p>and i have got next:</p>
  
  <blockquote>
    <p>in the fabricjs docs there is a property for the Object class calles
    'excludeFromExport'.</p>
    
    <p>Once set to true it should do exactly what you want.</p>
    
    <p>www.fabricjs.com/docs</p>
  </blockquote>
  
  <p>I went to:</p>
  
  <blockquote>
    <p>Source: fabric.js, line 12350 excludeFromExport </p>
  </blockquote>
  
  <p>And what now?</p>
  
  <p>My knowlage is to less to get to result from this. Does any one can give more informations: maybe one example?</p>
  
  <p>Thank you</p>