title: Printing a PDF file with Electron JS
body: <p>I am trying to create an Electron JS app that has the purpose to print letter size PDFs.</p>
  
  <p>This is my snippet of code for printing:</p>
  
  <pre><code>win = new BrowserWindow({
    width: 378, 
    height: 566, 
    show: true, 
    webPreferences: {
      webSecurity: false,
      plugins: true
    }
  });
  
  // load PDF
  win.loadURL('file://' + __dirname + '/header1_X_BTR.pdf');
  
  // if pdf is loaded start printing
  win.webContents.on('did-finish-load', () =&gt; {
    win.webContents.print({silent: true, printBackground:true});
  });
  </code></pre>
  
  <p>My issues are: if I have <code>print({silent:true})</code> my printer prints an empty page. If I have <code>print({silent:false})</code>, the printer prints in the same way as the screenshot, with headers, controls, etc. </p>
  
  <p><a href="https://i.stack.imgur.com/3U20L.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3U20L.png" alt="enter image description here"></a></p>
  
  <p>I need a silent print of the PDF content, and I can't manage to do it for days. Did anyone experience the same thing with Electron?</p>