title: Vaadin 14 Open new component in new Browser tab
body: <p>is there a way i can open a pdf embedded into a component and send to a new browser tab?</p>
  
  <p>The idea is to set the resource to this component and open in a new tab. I will need to in more buttons later to navigate between different documents.</p>
  
  <p><a href="https://i.stack.imgur.com/nocnL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nocnL.png" alt="enter image description here"></a></p>
  
  <pre><code>public class EmbeddedPdfDocument extends Component implements HasSize {
  
      public EmbeddedPdfDocument(StreamResource resource) {
          this();
          getElement().setAttribute("data", resource);
      }
  
      public EmbeddedPdfDocument(String url) {
          this();
          getElement().setAttribute("data", url);
      }
  
      protected EmbeddedPdfDocument() {
          getElement().setAttribute("type", "application/pdf");
          setSizeFull();
      }
  }
  </code></pre>