Cups

CUPS 支持哪些文件格式?

  • June 3, 2018

CUPS 支持的文件格式的完整列表是什麼?(即我可以直接輸入哪些文件類型lpr而無需先轉換它們?)

我一直在尋找答案,但沒有找到任何具體的答案。我能找到的最好的是“ CUPS 可以直接理解許多不同類型的文件,包括文本、PostScript、PDF 和圖像文件。 ”但這仍然相當模糊;特別是,它接受哪些圖像文件格式?

謝謝!

CUPS 使用MIME 數據庫來確定它可以執行哪些文件轉換。

數據庫由*.convs*.types文件組成。這兩個都有手冊頁:

cupsd 手冊頁列出了這些文件的位置:

  • /usr/share/cups/mime/mime.convs
  • /usr/share/cups/mime/mime.types

中通常有額外的 *.convs 和 *.types 文件/usr/share/cups/mime/,cupsd 也使用這些文件。

在我的 Slackware 14.2 系統上,我得到以下資訊:

$ grep -h "^[^#]" /usr/share/cups/mime/*.convs | sort
application/msword  text/vnd.cups-brf   30  texttobrf
application/octet-stream    application/vnd.cups-raw    0   -
application/pdf     application/vnd.cups-pdf        66  pdftopdf
application/pdf     text/vnd.cups-brf   100 texttobrf
application/pdf image/tiff      80       pstotiff
application/postscript      application/vnd.cups-postscript 66  pstops
application/postscript  application/pdf             0   pstopdf
application/postscript  image/tiff      80       pstotiff
application/rtf     text/vnd.cups-brf   30  texttobrf
application/vnd.adobe-reader-postscript application/vnd.cups-postscript 66  pstops
application/vnd.cups-pdf    application/vnd.cups-postscript 100 pdftops
application/vnd.cups-pdf    application/vnd.cups-raster 100 pdftoraster
application/vnd.cups-pdf    application/vnd.cups-raster 99  gstoraster
application/vnd.cups-pdf image/tiff 80 pstotiff
application/vnd.cups-pdf-banner application/pdf         32  bannertopdf
application/vnd.cups-postscript application/vnd.cups-raster 175 gstoraster
application/vnd.cups-postscript image/tiff 80 pstotiff
application/vnd.cups-raster image/pwg-raster        100 rastertopwg
application/vnd.openxmlformats-officedocument.wordprocessingml.document text/vnd.cups-brf   30  texttobrf
application/x-cshell        text/plain          100 -
application/x-cshell    application/pdf             32  texttopdf
application/x-csource       text/plain          100 -
application/x-csource   application/pdf             32  texttopdf
application/x-perl      text/plain          100 -
application/x-perl  application/pdf             32  texttopdf
application/x-shell     text/plain          100 -
application/x-shell application/pdf             32  texttopdf
application/xhtml   text/vnd.cups-brf   10  texttobrf
application/xml     text/vnd.cups-brf   10  texttobrf
image/gif           application/vnd.cups-raster 100 imagetoraster
image/gif       application/vnd.cups-pdf        65  imagetopdf
image/gif       image/vnd.cups-brf  70  imagetobrf
image/gif       image/vnd.cups-ubrl 70  imagetoubrl
image/jpeg          application/vnd.cups-raster 100 imagetoraster
image/jpeg      application/vnd.cups-pdf        65  imagetopdf
image/jpeg      image/vnd.cups-brf  70  imagetobrf
image/jpeg      image/vnd.cups-ubrl 70  imagetoubrl
image/pcx       image/vnd.cups-brf  70  imagetobrf
image/pcx       image/vnd.cups-ubrl 70  imagetoubrl
image/png           application/vnd.cups-raster 100 imagetoraster
image/png       application/vnd.cups-pdf        65  imagetopdf
image/png       image/vnd.cups-brf  70  imagetobrf
image/png       image/vnd.cups-ubrl 70  imagetoubrl
image/pwg-raster    application/pdf             32  rastertopdf
image/svg       image/vnd.cups-brf  70  imagetobrf
image/svg       image/vnd.cups-ubrl 70  imagetoubrl
image/tiff          application/vnd.cups-raster 100 imagetoraster
image/tiff      application/vnd.cups-pdf        65  imagetopdf
image/tiff      image/vnd.cups-brf  70  imagetobrf
image/tiff      image/vnd.cups-ubrl 70  imagetoubrl
image/urf       application/pdf             0   urftopdf
image/vnd.microsoft.icon    image/vnd.cups-brf  70  imagetobrf
image/vnd.microsoft.icon    image/vnd.cups-ubrl 70  imagetoubrl
image/x-bitmap          application/vnd.cups-raster 100 imagetoraster
image/x-bitmap      application/vnd.cups-pdf        65  imagetopdf
image/x-ms-bmp      image/vnd.cups-brf  70  imagetobrf
image/x-ms-bmp      image/vnd.cups-ubrl 70  imagetoubrl
image/x-photocd         application/vnd.cups-raster 100 imagetoraster
image/x-photocd     application/vnd.cups-pdf        65  imagetopdf
image/x-portable-anymap     application/vnd.cups-raster 100 imagetoraster
image/x-portable-anymap application/vnd.cups-pdf        65  imagetopdf
image/x-portable-anymap image/vnd.cups-brf  70  imagetobrf
image/x-portable-anymap image/vnd.cups-ubrl 70  imagetoubrl
image/x-portable-bitmap     application/vnd.cups-raster 100 imagetoraster
image/x-portable-bitmap application/vnd.cups-pdf        65  imagetopdf
image/x-portable-bitmap image/vnd.cups-brf  70  imagetobrf
image/x-portable-bitmap image/vnd.cups-ubrl 70  imagetoubrl
image/x-portable-graymap    application/vnd.cups-raster 100 imagetoraster
image/x-portable-graymap    image/vnd.cups-brf  70  imagetobrf
image/x-portable-graymap    image/vnd.cups-ubrl 70  imagetoubrl
image/x-portable-graymap application/vnd.cups-pdf       65  imagetopdf
image/x-portable-pixmap     application/vnd.cups-raster 100 imagetoraster
image/x-portable-pixmap application/vnd.cups-pdf        65  imagetopdf
image/x-portable-pixmap image/vnd.cups-brf  70  imagetobrf
image/x-portable-pixmap image/vnd.cups-ubrl 70  imagetoubrl
image/x-sgi-rgb         application/vnd.cups-raster 100 imagetoraster
image/x-sgi-rgb     application/vnd.cups-pdf        65  imagetopdf
image/x-sun-raster      application/vnd.cups-raster 100 imagetoraster
image/x-sun-raster  application/vnd.cups-pdf        65  imagetopdf
image/x-xbitmap         application/vnd.cups-raster 100 imagetoraster
image/x-xbitmap     application/vnd.cups-pdf        65  imagetopdf
image/x-xbitmap     image/vnd.cups-brf  70  imagetobrf
image/x-xbitmap     image/vnd.cups-ubrl 70  imagetoubrl
image/x-xpixmap         application/vnd.cups-raster 100 imagetoraster
image/x-xpixmap     application/vnd.cups-pdf        65  imagetopdf
image/x-xpixmap     image/vnd.cups-brf  70  imagetobrf
image/x-xpixmap     image/vnd.cups-ubrl 70  imagetoubrl
image/x-xwindowdump application/vnd.cups-pdf        65  imagetopdf
image/x-xwindowdump image/vnd.cups-brf  70  imagetobrf
image/x-xwindowdump image/vnd.cups-ubrl 70  imagetoubrl
text/css            text/plain          100 -
text/html           text/plain          100 -
text/html       application/pdf             32  texttopdf
text/html       text/vnd.cups-brf   10  texttobrf
text/plain      application/pdf             32  texttopdf
text/plain      text/vnd.cups-brf   0   texttobrf
text/rtf        text/vnd.cups-brf   30  texttobrf

cupsfilter您還可以通過直接呼叫文件和--list-filters選項(不會列印文件)來查看轉換將使用哪些過濾器:

$ cupsfilter --list-filters foo.png
imagetoraster
rastertopwg
rastertopdf

(注意:我通過 設置了預設列印機lpoptions,因此我不必提供列印機名稱。如果必須,您可以cupsfilter使用-d選項將列印機名稱傳遞給。)

引用自:https://unix.stackexchange.com/questions/372379