CUPS Linux:帮助打印以下媒体类型:MS Excel,MS Word和HTML [英] CUPS Linux: Help printing these media types: MS Excel, MS Word and HTML

查看:128
本文介绍了CUPS Linux:帮助打印以下媒体类型:MS Excel,MS Word和HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Linux CUPS服务器中打印MS Excel,MS Word和HTML文件.当我尝试打印这些媒体类型时,会发生以下情况,这是我到目前为止发现的内容:

  • 对于MS Excel和MS Word文件:

    当我尝试打印此类文件时,错误输出为:

     <代码> alvaro @ alvaro-VM:〜$ lp -d test_printer -o document-format = application/msword ptest.doclp:不支持的格式"application/msword"! 

    或者,相同:

      alvaro @ alvaro-VM:〜$ lp -d test_printer ptest.doclp:不支持的格式"application/msword"! 

    我发现搜索周围的东西是可以使用 CUPS过滤器,在这种情况下,我发现它被称为" officetop "( sourceforge/download链接),则可以打印MS OFFICE文件.我使用此台式"过滤器的问题是我不知道如何安装或配置它,或者需要任何使其工作的内容,而我找不到任何教程或指南.因此,我将对此表示感谢.您是否建议使用此过滤器执行此任务?我愿意接受任何其他解决方案.

  • 对于HTML文件:

    作为我的第一个测试:

      alvaro @ alvaro-VM:〜$ lp -d test_printer -o document-format = text/html index.html要求的编号为test_printer-105(1个档案) 

    然后,得出相同的结果:

      alvaro @ alvaro-VM:〜$ lp -d test_printer index.html要求的编号为test_printer-106(1个档案) 

    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>有效!</h1>< p>这是html打印测试.</body></html> 

    结果:在打印的纸张上,您只能看到html代码而不是格式化的文本.

    如果我从网络浏览器(如chrome)打印网页,则打印效果很好,但是如果我使用浏览器选项另存为网页"下载网页,然后发出* lp -d test_printer index.html *与我之前提到的相同,只是打印了html代码.

    请对此提供帮助.我想要的是获取可能的格式化文本.还可以打印HTML + CSS吗?.

非常感谢你们.

关于.

PD:对不起我的英语.

解决方案

请记住,Linux从/etc/mailcap 获取有关打开哪些类型文件的说明.同样,任何类型的打印文件都需要由能够执行此操作的应用程序渲染"或编译",因此引用了/etc/mailcap .电子邮件应用程序无法呈现" Excel文件,而Photoshop也无法打开HTML文件:)

从外观上看,您的/etc/mailcap中没有条目用于处理Excel,Word或HTML文件的应用程序,这就是为什么打印原始内容而不是渲染的"页面的原因(如果您从Linux打印).

您是从Linux还是在打印?从Windows?如果您是从Windows(通过Linux盒子上的cups服务器)打印的,并且可以正常打印,那么您知道问题不是打印机,而是Linux上的/etc/mailcap .

I need to print MS Excel, MS Word and HTML files in a Linux CUPS server. When i try to print thses media types following occurs and this is what i've found till now:

  • For MS Excel and MS Word files:

    When i try to print a file like these 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:

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

    What i've found searching arround is that supposedly it is possible to use a CUPS filter, in this case the one i've found is called "officetop" (sourceforge/download link), taht would be possible to print MS OFFICE files. The problem i have with this "officetop" filter is that i don't know how to install it or counfigure it or whatever it needs to make it work and i couldn't find any tutorial or guide. So i wiil appreciate any help on this. Do you recommend use this filter to do this task? i'm open to any alternative solution.

  • For HTML files:

    As a first test i made:

    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, which 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 the printed sheet you can see just de html code instead the formated text.

    EDIT: If i print a web page from the web browser like chrome it gets well printed but If i download the web page with the browser option "Save web page as" and then issue *lp -d test_printer index.html* occours the same i mentioned before, just the html code gets printed.

    Please help on this. what I want is to get the formated text it is posible. It is also possible to print HTML+CSS?.

Thank you very much guys.

Regards.

PD: sorry about my english.

解决方案

Remember Linux gets it's instructions on which applications to open which types of files from /etc/mailcap. Also, any type of file that is printed needs to be "rendered" or "compiled" by an application that is able to do so, hence the reference to /etc/mailcap. An e-mail application cannot "render" an Excel file, and Photoshop cannot open HTML files :)

By the looks of it, you do not have an entry in your /etc/mailcap for an application to handle Excel, Word or HTML files, that is why the raw content is printed and not the "rendered" page (if you are printing from Linux).

Are you printing from Linux or from Windows?. If you print from Windows (through the cups server on your Linux box) and it prints normal, then you know the problem is not the printer but /etc/mailcap on Linux.

这篇关于CUPS Linux:帮助打印以下媒体类型:MS Excel,MS Word和HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆