title: PDF validate using PDFBOX PreflightParser for PDDocument
body: <p>I could like to validate the pdf that was created(not as a file) but as ByteArrayOutputStream which is downloaded to browser . In order to avoid security issue could like to validate using pdfbox preflightparser where it has option only for parsing file not PDDocument.</p>
  
  <pre><code>ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
  doc.save(byteArrayOutputStream);
  PreflightParser parser = new PreflightParser(doc);
  </code></pre>
  
  <p>//this constructor accepts only file.</p>
  
  <p>Expectation is validate pdf file on the fly instead of loading from system.</p>