Image on report not printed

Stimulsoft Reports.JS discussion
MarekK
Posts: 5
Joined: Mon Nov 11, 2019 11:20 am

Re: Image on report not printed

Post by MarekK »

Hi Guys,

It looks like there is a CSS option available to force the browser (Firefox, Chrome) to print background images: https://stackoverflow.com/a/21160150
Could it be added to the standard CSS options?

Thanks,
Marek
Lech Kulikowski
Posts: 6358
Joined: Tue Mar 20, 2018 5:34 am

Re: Image on report not printed

Post by Lech Kulikowski »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more detail, for which component do you need background?

Thank you.
MarekK
Posts: 5
Joined: Mon Nov 11, 2019 11:20 am

Re: Image on report not printed

Post by MarekK »

Hi Lech,

I have attached screenshots from our Web application. We use the Report Viewer to display the report and allow a user to print it.
As you can see on the print preview the image from the top left corner is missing. It won't be printed unless you check the option to print 'Background images' which is disabled as a default (it isn't solution for us to inform all users to select that option during the printing process). I have investigate it a little bit and it is caused by the way images are displayed in the viewer: they are not images elements (<img>), but they are set as background image in the CSS.

I have found that adding an extra CSS class to the element resolves that problem:
-webkit-print-color-adjust: exact;

Thanks,
Marek
Attachments
ReportViewer.png
ReportViewer.png (108.35 KiB) Viewed 2077 times
PrintSettings.png
PrintSettings.png (123.89 KiB) Viewed 2077 times
Lech Kulikowski
Posts: 6358
Joined: Tue Mar 20, 2018 5:34 am

Re: Image on report not printed

Post by Lech Kulikowski »

Hello,

Thank you for the information.
csrt
Posts: 49
Joined: Thu Jan 17, 2019 12:38 pm

Re: Image on report not printed

Post by csrt »

MarekK wrote: Wed Nov 27, 2019 11:28 am Hi Lech,

I have attached screenshots from our Web application. We use the Report Viewer to display the report and allow a user to print it.
As you can see on the print preview the image from the top left corner is missing. It won't be printed unless you check the option to print 'Background images' which is disabled as a default (it isn't solution for us to inform all users to select that option during the printing process). I have investigate it a little bit and it is caused by the way images are displayed in the viewer: they are not images elements (<img>), but they are set as background image in the CSS.

I have found that adding an extra CSS class to the element resolves that problem:
-webkit-print-color-adjust: exact;

Thanks,
Marek
Hello MarekK. I am facing the same problem. Can you be more specific about the solution that worked for you?
To what element did you applied the CSS class? And how you did that?

Thank you.
Post Reply