title: How to convert ByteBuffer to pdf
body: <p>In my application a pdf report only opens in print preview which allows user to directly print the pdf document. Now i want to automate this to verify the pdf content.</p>
  
  <p>I have got the pdf content through an api which is in base64 [did split to get only data], i tried converting to byte array after decoding but it only prints junk characters.[byte array to string]
  Now i have converted this data into ByteBuffer and want this to write in pdf.</p>
  
  <pre><code>ByteBuffer decodedBytes = new BASE64Decoder().decodeBufferToByteBuffer(
      new String(base64split2[1].substring(0, base64split2[1].length() - 1))
  );
  </code></pre>
  
  <p>Can someone tell me how do i convert this decodedBytes  of ByteBuffer to pdf.</p>
  
  <p>Thanks</p>