LINUX CUPS print background bars

Posted on 2007-10-16
Last Modified: 2013-12-15
Can LINUX CUPS print background bars to make reports easier to read?
if so, how?
Question by:waipahu
    LVL 8

    Expert Comment

    do you mean to ask if cups can print alternating light background colors in a table?  sure.  If you format the print job to do just that.

    care to be more specific about what you are looking for?

    Author Comment

    Yes that's what I want.  
    The reports will be accounting reports.  I want to have alternating horizontal grey bars going across the page to make it easier for the users to read.

    LVL 8

    Accepted Solution

    cups by itself doesnt do alot of document formatting, and you dont really want it do to much beyond formatting the job to fit the printer and adding paper tray options and stuff.

    I'm assuming that you have some control over the app thats generating those reports, any way you can tell that app to print with alternating background rows?

    it would be really difficult for cups to be able to process a print job figure out which parts to add the alternating background to, and which parts NOT to.

    You best bet is to get the application that generated the report to do the background, or at least underline data rows.


    Author Comment

    All i want to do is simulate a GREEN BAR report like a mainframe report. From top to bottom print alternating rows of grey bars.
    Is there a simple of way doing this?
    LVL 8

    Expert Comment

    is the report generated by the server as a plain text file? or is it generated by the clients as part of an application?

    If its a server generated text file, then you can write a txt to html conversion file that creates a html table with one row/cell per line in the text file, you can count the number of rows youve processed and if the row counter is odd add a background = #color option to the row, if its even, leave it out.

    then when the html is rendered by the postscript imager this background is automatically added.

    let me know if this is an option you can consider, if it isnt, maybe there is something else.


    Author Comment

    The report by a batch application program in plain ascii text file on our server.
    Currently, in the script, a lpr statement is used to send it to the printer.
    I just thought there might be a way to print the grey shade bars in the background for readability.

    I don't want to modify our exisiting programs to embed code to print out the grey bars.

    Any ideas?

    LVL 39

    Assisted Solution

    As you are using a postscript emulator printer (i.e. cups common printing language = post script),
    you can use 'enscript --highlight-bars=1 ascii-file' to print them.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
    It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now