title: Convert PDF to a Base64-encoded string in Javascript
body: <p>I need to encode a PDF file to Base64 with Javascript. I can create Base64-encoded jpeg or png images in Javascript, but I could not find any way or sample code to create a Base64-encoded string from a PDF file.</p>
  
  <p>Is it there any solution using a HTML5 canvas?</p>
  
  <p>Thanks.</p>