Issue displaying a PDF document using <image>

ok this works as expected in an iframe

      String filePath = "A17_FlightPlan.pdf";
        File file = ResourceUtils.getFile(filePath);
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(FileUtils.readFileToByteArray(file));
        final StreamResource resource = new StreamResource(filePath,
                () -> byteArrayInputStream);
        final StreamRegistration registration = VaadinSession.getCurrent().getResourceRegistry().registerResource(resource);
        htmlObject.setSrc(registration.getResourceUri().toString());
2 Likes