Maybe you can be more compatible if you implement a plugin using something

Maybe you can be more compatible if you implement a plugin using something like that:

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.HasSize;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.server.StreamResource;

@Tag("object")
public class PDFViewer extends Component implements HasSize {

    public PDFViewer(StreamResource resource) {
        this();
        getElement().setAttribute("data", resource);
    }

    public PDFViewer(String url) {
        this();
        getElement().setAttribute("data", url);
    }

    private PDFViewer() {
        getElement().setAttribute("type", "application/pdf");
        setSizeFull();
    }
}

I force to display using

StreamResource resource = new StreamResource("blah", () -> new ByteArrayInputStream(reportPDFBytes));
resource.setContentType("application/pdf");
resource.setCacheTime(0);
PDFViewer viewer = new PDFViewer(resource);
add(viewer);

On this case we dont have message, but you can implement creating a component more flexible,

Dare to contribute this as a PR?

Thank you Luis, that works. Not sure how I missed it because in the old code I did set the content type and cache timeout.

Thank you for the quick response.