printing chinese from command line

Hello,
I need to be able to print Chinese documents form the command line. I have the fonts installed and a cat of the file shows it correctly. I can also open it in gedit and print from there and it works correctly. However printing from the command line does not wok.

Does anyone know the magic incantation that will allow it?
Thanks

Care to share how you’re trying, what the command is, maybe a bit more
about the file? I presume it’s just text, vs. a PDF, vs. an ODT/ODF, etc.

Also, which version of SLES (including SP)?


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Care to share how you’re trying, what the command is, maybe a bit more
about the file? I presume it’s just text, vs. a PDF, vs. an ODT/ODF, etc.

Also, which version of SLES (including SP)?

Of course. The file is a txt file. I have these locales loaded:
zh_CN
zh_CN.gb18030
zh_CN.gbk
zh_CN.utf8
zh_HK
zh_HK.utf8
zh_SG
zh_SG.gbk
zh_SG.utf8
zh_TW
zh_TW.euctw
zh_TW.utf8

Here is a snippet of the file
$ sed 2q Chinese\ Article.txt 
近年来,北京市互联网迅速发展,据中国互联网信息中心(CNNIC)2005年1月公布的第十五次互联网报告统计显示,我国上网计算机数量已达到4160万,上网总人数达到9400万,其中北京地区上网人数为402万;CN域名数全国432077个,北京地区有87371个,占总数的20.3% ,WWW站点总数为668900个,北京地区有125297个,占总数的18.7%。然而,北京地区已备案的网站只有不到两千家,所以根据我国“计算机信息网络国际联网安全保护管理办法”的第二章“安全保护责任”中的第十一条规定“用户在接入单位办理入网手续时,应当填写用户备案 表。备案表由公安部监制。”;第十二条规定“互联单位、接入单位、使用计算机信息网络国际联网的法人和其他组织(包括跨省、自治区、直辖市联网的单位和所属的分支机构),应当自网络正式联通之日起三十日内,到所在地的省、自治区、直辖市人民政府公安机关指定的受理机关办理备案手续。前款所列单位应当负责将接入本网络的接入单位和用户情况报当地公安机关备案,并及时报告本网络中接入单位和用户的变更情况。”;我处定于即日起集 中开展中小网站备案工作。
  即日起凡是未在公安部门备案的中小网站、个人主页等联网单位负责人,请速到注册地公安机关信通处网监部门填写备案表。此项工作截止到2005年6月30 日。此项工作结束后,北京市公安局网监处将依法开展网站备案检查,对未履行备案职责的,将依据“计算机信息 网络国际联网安全保护管理办法”的第四章“法律责任”中的第二十三条规定“违反本办法第十一条、第十二条规定,不履行备案职责的,由公安机关给予警告或者停机整顿不超过六个月的处罚”的规定予以处罚。

SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 3

gedit can open and print the file correctlty, as well as libre office.
I’m trying to print it with lp -dprintername file.txt

What else can I tell that might help?
/ Sid /

What do you get from this command?

set | grep '^LC'

For what it is worth, I do not often work with Chinese (or other
double-byte) text files from the command line, so I’m rapidly reaching the
end of my usefulness, but I suspect that if you set your LC_CTYPE or some
other local environment variable that you may get lucky, assuming ‘lp’
uses those somehow.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

set | grep ‘^LC’ returns nothing.
I do have LANG set - currently LANG=en_US.UTF-8

Perhaps try exporting that to one of the locales that should match the file.

export LANG=zh_CN

Note: I do not know tat the value above is totally valid, as it does not
have two parts to it like the original value does.

Once done, try the ‘lp’ command again.

Another option: I see a lot of references online to ‘paps’ solving this
problem, but I do not know where best to etch that, though I do see it
available via the Open Build Service (OBS) from another user:

https://software.opensuse.org/package/paps?search_term=paps

Googling for “using lp print chinese file” (sans quotes) turned up a fair
number of hits that led to the ‘paps’ command finding.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Setting LANG and printing does not work - I’ll check out paps/pango

Turns out pango is already installed on the system- doesn’t seem to help though - at least not uness some magic incantation is necessary which I don’t know.

Could you post the file somewhere for others to try printing it?

A service I just enable today, which is free for up to 100 MiB transfers,
is SkyDrop (from SkyBox), which is a company with whom I’ve worked before,
so that may be wroth trying out: https://skybox.biz/

Disclaimer: As written, I’ve worked with SkyBox before, so feel free to
consider me biased.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…