title: PDF.js able to create pdf file or PDF.js is just a function to let PDF file display on web broswer?
body: <p>this is PDF.js site</p>
  
  <pre><code>https://github.com/mozilla/pdf.js
  </code></pre>
  
  <p>I m searching and reading a lot of article, most all the coding are import the pdf into <code>pdf.js</code> and display on browser, i cannot understand is it PDF.js able to create pdf format and display on web browser without download the PDF file?</p>
  
  <p>this is the sample code i have found :</p>
  
  <pre><code>'use strict';
  
  //
  // Fetch the PDF document from the URL using promises
  //
  PDFJS.getDocument('helloworld.pdf').then(function(pdf) {
    // Using promise to fetch the page
    pdf.getPage(1).then(function(page) {
      var scale = 1.5;
      var viewport = page.getViewport(scale);
  
      //
      // Prepare canvas using PDF page dimensions
      //
      var canvas = document.getElementById('the-canvas');
      var context = canvas.getContext('2d');
      canvas.height = viewport.height;
      canvas.width = viewport.width;
  
      //
      // Render PDF page into canvas context
      //
      var renderContext = {
        canvasContext: context,
        viewport: viewport
      };
      page.render(renderContext);
    });
  });
  </code></pre>
  
  <p>if PDF.js able to create pdf file , and get the data from MySQL database generate a table display on PDF, how is it work?</p>