Printing options questions

Printing options questions

mrimachinemrimachine Posts: 1Questions: 1Answers: 0
edited September 2023 in Free community support

Is there a way I can change all text color to black when printing, can I make the dividing line between rows darker, and lastly, is it possible to remove link decorations from print without stripping all the HTML out of the page?

This is what I have so far under my print button.

{
                        "extend": 'print',
                        "autoPrint": false,
                        "title": title,
                        "messageTop": PrintPageHeader(),
                        "customize": function (win) {
                            var css = '@page { size: portrait; }',
                                head = win.document.head || win.document.getElementsByTagName('head')[0],
                                style = win.document.createElement('style');

                            style.type = 'text/css';
                            style.media = 'print';
                            if (style.styleSheet) {
                                style.styleSheet.cssText = css;
                            }
                            else {
                                style.appendChild(win.document.createTextNode(css));
                            }

                            head.appendChild(style);
                        },
                        "exportOptions": {
                            columns: [0, 1, 2, 3, 4],
                            stripHtml: false,
                        }
}

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,522Questions: 1Answers: 10,272 Site admin
    Answer ✓

    Hi,

    It looks like you are already adding a stylesheet using the customize function. That's how you control the styling of the print view. Add suitable CSS to get the styling you want.

    You've only got a single rule in it at the moment - you'd need the additional CSS to get the styling you require.

    Allan

Sign In or Register to comment.