title: Preview pdf file created with TCPDF in embed tag after Ajax call
body: <p>So my application generates pdf files using TCPDF, and that works fine. That is done inside php file, called with ajax. I'm using embed tag to preview them like:</p>
  
  <pre><code>$.ajax({
  url: 'create_pdf_file.php',
  success: function(){
      /* https://stackoverflow.com/questions/17083018/jquery-loads-cached-file-inside-ajax-success-function */
      $('#pdf_placeholder embed').attr('src','output/my_file.pdf?v=' + Math.random()');
     }
  });
  </code></pre>
  
  <p>Because many users could generate my_file.pdf at the same time, there could be a case when one user will preview a file generated for another user. So my question at this point is how to force TCPDF to output directly into that tag, not using temp file</p>
  
  <pre><code> Output('my_file','I')
  </code></pre>
  
  <p>not working here after ajax. 
  There is <a href="https://stackoverflow.com/a/4708660/1791306">an advice</a> here to echo pdf directly back, but i don't know how to do that or is it possible at all. Anyway will try with <code>success(data)</code> to receive that like json. </p>
  
  <p>Other workaround is to give session-bond file name for each user, but is using session_id() and appending to the file name is safe? Most probably I will end with generating UID for each session.</p>
  
  <p>Any general advices are welcome.</p>