title: What is the best way to convert a pdf file into base64Binary?
body: <p>Using python, I want to <code>convert a pdf file into base64Binary</code></p>
  
  <p>My logic(not python) is reading the contents of the file into a byte array and then use something like <code>Convert.ToBase64String() method</code> to get the <code>Base64 string</code>:</p>
  
  <pre><code>byte[] pdfBytes = File.ReadAllBytes(pdfPath);
  string pdfBase64 = Convert.ToBase64String(pdfBytes);
  </code></pre>
  
  <p>Please let me know what is the right approach to <code>convert a pdf file into base64Binary</code> in python</p>