title: Microsoft Edge issue on export HTML to PDF in ASP.NET Core
body: <p>I am trying to generate pdf from Html on an <strong>ASP.Net Core Web</strong> project. I haven't found much on web regarding this. Most of the packages are not ready for asp.net core. After browsing for days, I found <a href="https://code.msdn.microsoft.com/How-to-export-HTML-to-PDF-c5afd0ce" rel="nofollow noreferrer">this <em>How to export HTML to PDF in ASP.NET Core</em></a></p>
  
  <p>I have downloaded the project </p>
  
  <blockquote>
    <p>Export to pdf works perfectly on chrome but not on <strong>Edge</strong>; It just never finished the export.</p>
  </blockquote>
  
  <p>Is there any issue with Edge and pdf I haven't do much work on node.js so not sure what is going wrong. Any help will be highly appreciated. Here, I also add the code from pdf.js</p>
  
  <pre><code>module.exports = function (callback, html) { 
      var jsreport = require('jsreport-core')(); 
  
      jsreport.init().then(function () { 
          return jsreport.render({ 
              template: { 
                  content: html, 
                  engine: 'jsrender', 
                  recipe: 'phantom-pdf' 
              } 
          }).then(function (resp) { 
              callback(null, resp.content.toJSON().data); 
          }); 
      }).catch(function (e) { 
          callback(e, null); 
      }) 
  }; 
  </code></pre>
  
  <p>And the package.json for nodejs</p>
  
  <pre><code>{ 
    "name": "pdf", 
    "version": "1.0.0", 
    "description": "", 
    "main": "index.js", 
    "dependencies": { 
      "jsreport-core": "^1.3.1", 
      "jsreport-phantom-pdf": "^1.4.4", 
      "jsreport-jsrender": "^1.0.2" 
    }, 
    "devDependencies": {}, 
    "scripts": { 
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1" 
    }, 
    "author": "", 
    "license": "ISC" 
  } 
  </code></pre>
  
  <h2>Updated</h2>
  
  <p>@Martin Beeby find the issue on Controller code. The following code is not working on MS Edge</p>
  
  <pre><code>public class HomeController : Controller
  {
      [HttpGet]
      public async Task&lt;IActionResult&gt; Index([FromServices] INodeServices nodeServices)
      {
          HttpClient hc = new HttpClient();
          var htmlContent = await hc.GetStringAsync($"http://{Request.Host}/report.html");
  
          var result = await nodeServices.InvokeAsync&lt;byte[]&gt;("./pdf", htmlContent);
  
          HttpContext.Response.ContentType = "application/pdf";
  
          HttpContext.Response.Headers.Add("x-filename", "report.pdf");
          HttpContext.Response.Headers.Add("Access-Control-Expose-Headers", "x-filename");
          HttpContext.Response.Body.Write(result, 0, result.Length);
          return new ContentResult();
      }
  }
  </code></pre>