Print in Color

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Print in Color

Post by rpierce » 2024-02-08 23:49

How can I make the app print in color?

When I add color in a rich text/html field, it will only print in b&w even if I use the system dialog. It is the same on any computer I print on using my app.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1817
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Print in Color

Post by jsetzer » 2024-02-09 05:23

How can I make the app print in color?
Bootstrap and the available Bootswatch Themes change colors to black/transparent for @media print by default, as far as I know.

You should be able to overwrite those style definitions by defining your custom CSS styles.

You can open your browser's developer tools (F12), in Sources tab, find you specific CSS file or files, search for @media print.

There you will see all color- and background-color-definitions for printout.

Example

chrome_ewtQw79EwR.png
chrome_ewtQw79EwR.png (232.59 KiB) Viewed 254 times
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1817
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Print in Color

Post by jsetzer » 2024-02-09 05:45

I did some tests. First I changed background-color of <pre>-elements with the following CSS:

Code: Select all

<style>
pre {
    background-color: lightgoldenrodyellow !important;
}
</style>
In print preview, Bootstrap renders those in black/transparent:

chrome_taLYsh11XM.png
chrome_taLYsh11XM.png (13.92 KiB) Viewed 252 times

After overwriting those styles for @media print like this...

Code: Select all

<style>
    pre {
        background-color: lightgoldenrodyellow !important;
    }

    @media print {
        * {
            text-shadow: none !important;
            color: #000 !important;
            background: transparent !important;
            box-shadow: none !important;
        }
    }
</style>
... I've seen that print preview still renders in black/transparent, unfortunately, but then I have seen the following option in browser's printing dialog:

chrome_WLl8Xf5QIz.gif
chrome_WLl8Xf5QIz.gif (185.65 KiB) Viewed 252 times

There is an option for background-graphics. So, you may check if there is such an option in your printer settings dialog.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: Print in Color

Post by rpierce » 2024-02-28 16:21

Thank you again, Jan as usual you're such a great help to everyone!

Post Reply