title: open dompdf in new tab taken data from given page
body: <p>I know that there are at least two other similar questions, but they do not help me.</p>
  
  <p>I have textarea with tinymce where user writes his text. Then there is a button "PDF" that should create pdf and open it in new tab. The content of pdf is the content in tinymce.</p>
  
  <p>When user click on button, the form is submitted to index.php action. Then index.php gathers information from $_POST variable and creates pdf.</p>
  
  <p>I cannot get it to open in new tab as a normal link. 
  I tried it in different ways.</p>
  
  <p>1) I can open PDF in the same tab, but this is not what I need. This line opens my pdf on the same tab:</p>
  
  <pre><code>$dompdf-&gt;stream('document.pdf',array('Attachment'=&gt;0));
  </code></pre>
  
  <p>2) I can open it in new window, but then browser warns that this is pop-up. Client doesn't want it. Also another problem with this is that pdf is stored on server. I do not want it (pop-up warning is more important).  Here is my code:</p>
  
  <pre><code>$output = $dompdf-&gt;output();
  file_put_contents('document.pdf', $output); //save pdf on server
  
  //opens generated pdf in new window, but this creates warning for popup
  echo '&lt;script type="text/javascript" language="javascript"&gt; 
  window.open("http://modeles-de-lettres.org/test/saved_pdf.pdf", "_blank"); 
  &lt;/script&gt;'; 
  </code></pre>
  
  <p>I have read those:</p>
  
  <p>1) <a href="https://stackoverflow.com/questions/11113562/open-pdf-in-a-new-tab-using-dompdf">Open PDF in a new tab using dompdf</a></p>
  
  <p>This suggests: "As far as opening in a new tab. That depends on how you are generating the PDF. But the simplest way it to provide a link with a target attribute." I think this means that I have </p>
  
  <pre><code>&lt;a href="my.pdf" target="blank" 
  </code></pre>
  
  <p>or </p>
  
  <pre><code>&lt;a href="my.php" target="blank" 
  </code></pre>
  
  <p>But this does not work for me, because I should POST my form to get data from pdf.</p>
  
  <p>2) <a href="https://stackoverflow.com/questions/17419535/generate-the-pdf-on-newtab-in-dompdf">generate the pdf on newtab in dompdf</a></p>
  
  <p>This is something that I have implemented before (I did it without sessions), but it creats warning about popups.</p>