title: PDF.JS Preview large pdf file (> 200MB) on client side, that was sent from server side
body: <p>I'm working with a pdf viewer, that will load a pdf file from server (nodejs) and then rendering on client side to allow user reading direct in my site.</p>
  
  <p>I'm using <a href="https://github.com/mozilla/pdf.js" rel="nofollow noreferrer">pdf.js</a> to rendering pdf file on client side. The problem is client side must download entire pdf file before they can parse and render it, so if the file is too large (~200MB in my case), user must wait for download entire 200MB.</p>
  
  <p>I researched and i think i can solve this problem by 2 ways:</p>
  
  <ul>
  <li><p>Split the large pdf file into many smaller pdf files on the server side, and serve only specific small file on-demand. But this way, i will lost some important metadata like the pdf outlines,...</p></li>
  <li><p>Using pdf.js direct in server side, get the pdf pages and then serve each page as binary to client side, client side will also use pdf.js (addPage function) to add each page to their viewer. But i don't know it is possible or not.</p></li>
  </ul>
  
  <p>So what should i do to solve this problem?
  Thank you so much.</p>