Any fixes for print button not working ?
It takes wrong URL for file (without context root of app) thus file not found 404 and print button not working.
Any fixes for print button not working ?
It takes wrong URL for file (without context root of app) thus file not found 404 and print button not working.
Hello Tadej. Can you create an issue here adding more information like component version, vaadin version, maybe a reproducible example?. Thanks.
This is how I create the URL for the setSrc method. This way the printing works as well. It is discussed here: Issue
private String getPDFUrl(String fileName, byte[] pdfFile) { StreamResource sr = new StreamResource(fileName, () -> new ByteArrayInputStream(pdfFile));VaadinRequest vaadinRequest = VaadinService.getCurrentRequest();
HttpServletRequest httpServletRequest =
((VaadinServletRequest) vaadinRequest).getHttpServletRequest();StreamRegistration streamRegistration =
VaadinSession.getCurrent().getResourceRegistry().registerResource(sr);return httpServletRequest.getScheme()
+ “://”
+ httpServletRequest.getServerName()
+ “:”
+ httpServletRequest.getServerPort()
+ httpServletRequest.getContextPath()
+ “/”
+ streamRegistration.getResourceUri();
}