title: Vaadin: Opening a new window with PDF content placed in a String variable
body: <p>I'd like to open a new window with PDF content that is placed within a String variable.
  I already have a button with an event connected. In this event I want to call the new window.</p>
  
  <p>The method looks like this:</p>
  
  <pre><code>private void show_archivobjekt(String data) {
  String pdf = anfrage.get_archivobjectdata(data);
  System.out.println(pdf);  // This shows my PDF content in console and works!
  
      // How to convert this String into a StreamSource
  
      StreamResource streamResource = new StreamResource(pdfss, "test.pdf",  myView);
      streamResource.setCacheTime(5000);
      streamResource.setMIMEType("application/pdf");
      myView.getMainWindow().open(streamResource, "_blank");
  }
  </code></pre>
  
  <p><strong>myView</strong> is the Application.
  How can I convert the <strong>String pdf</strong> to a StreamSource (<strong>pdfss</strong>)? Do I have to save it as file at first or is it possible to convert it to a StreamSource directly in memory?</p>
  
  <p>The console output shows me the typically PDF content starting with %PDF-1.3 ... and so on.</p>
  
  <p>Any help would be appreciated. Thanks in advance!</p>
  
  <p>Rainer</p>