In Java and Vaadin I tried the answer of Ayra successfully. I have got the bytes[] from a file. They could be got from any other source.
public class View extends Div {
public View() {
String myHTML_1="<object data=\"data:application/pdf;base64,$CONTENT$\" type=\"application/pdf\" style=\"height:200px;width:60%\"></object>";
Base64.Encoder enc = Base64.getEncoder();
String base64=""; //Get the content form a file.
try {
base64 = new String(enc.encode(Files.readAllBytes(Paths.get("/home/ximo/test.pdf"))));
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
String myHTML_1X=myHTML_1.replace("$CONTENT$",base64);
add(new Html(myHTML_1X)); // and works in Chrome!
}