CUPS Linux: Help print these types of media: MS Excel, MS Word and HTML

I need to print MS Excel, MS Word and HTML files on a Linux CUPS server. When I try to print these types of media, the following happens, and this is what I have found so far:

  • For MS Excel and MS Word files:

    When I try to print a file like this, the error output is:

    alvaro@alvaro-VM :~$ lp -d test_printer -o document-format=application/msword ptest.doc lp: Unsupported format 'application/msword'! 

    or, the same thing:

     alvaro@alvaro-VM :~$ lp -d test_printer ptest.doc lp: Unsupported format 'application/msword'! 

    What I found in arround search is that it is possible to use the CUPS filter, in this case the one I found is called "officetop" ( sourceforge / download link ), taht it will be possible to print MS OFFICE files. The problem with this officetop filter is that I donโ€™t know how to set it up or specify it, or whatsoever it does so that it works, and I could not find a textbook or manual. Therefore, I appreciate any help with this. Do you recommend using this filter to accomplish this task? I am open to any alternative solution.

  • For HTML files:

    As a first test, I did:

     alvaro@alvaro-VM :~$ lp -d test_printer -o document-format=text/html index.html the requested id is test_printer-105 (1 archivo(s)) 

    And, that gave the same result:

     alvaro@alvaro-VM :~$ lp -d test_printer index.html the requested id is test_printer-106 (1 archivo(s)) 

    index.html

     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><body><h1>It works!</h1> <p>This is a html print test.</p> </body></html> 

    Result: on a printed sheet, you can see only html code instead of formatted text.

    EDIT: if I print a web page from a web browser, for example, chrome, it will print well, but if I load a web page with the browser option "Save the web page as", then it will give * lp -d test_printer index. html * occures is the same as I mentioned earlier, just the html code is printed.

    Please help with this. I want the generated text to be right. Is it also possible to print HTML + CSS ?.

Thanks so much guys.

Sincerely.

PD: sorry for my english.

+6
source share
1 answer

Remember that Linux receives instructions on which applications to open file types with / etc / mailcap . In addition, any type of printable file must be "displayed" or "compiled" by an application that can do this, so thereโ€™s a link to / etc / mailcap . An email application cannot โ€œrenderโ€ an Excel file, and Photoshop cannot open HTML files :)

According to him, you do not have an entry in / etc / mailcap for the application for processing Excel, Word or HTML files, so the original content is printed, not a "visualized" page (if you print from Linux).

Are you printing from Linux or from Windows ?. If you print from Windows (via the cup server in your Linux box) and it prints normally, then you know that the problem is not with the printer, but with Linux / etc / mailcap .

+2
source

All Articles