ubuntu/Linux PDF文件中文无法显示或中文为方块的解决方法

 

ubuntu1004,pdf文件有的无法显示中文,解决办法如下:

 

1. 先安装字体

        A. sudo apt-get install xpdf-chinese-simplified;

        B. sudo apt-get install xpdf-chinese-traditional.

 

 

2. 装完后打开pdf文件,中文还是不显示,继续安装:

        C. sudo apt-get install poppler-data

 

 

此时pdf文件已经可以显示中文,但问题又来了,有些文件中中文是方块,怎么办?

 

下面是别人的解决方法,试过,可行:

 

xpdf有些中文pdf显示的都是方块,在看了很多网页后发现是字体问题,可以尝试更改下面这个文件 

sudo gedit /etc/fonts/conf.d/69-language-selector-zh-cn.conf



有些中文pdf显示的都是方块,可以将上面这个文件中的第二个大块的第一项改为中文(<string>AR PL UMing CN<string>如果不好看可以改为<string>WenQuanYi Zen Hei</string>),就可以解决问题:

 

 

#下面是我的69-language-selector-zh-cn.conf文件 <fontconfig> <match target="pattern"> <test qual="any" name="family"> <string>serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Microsoft YaHei</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>WenQuanYi Bitmap Song</string> <string>Bitstream Vera Serif</string> <string>DejaVu Serif</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>AR PL UMing CN<string> <string>Microsoft YaHei</string> <string>Bitstream Vera Sans</string> <string>DejaVu Sans</string> <string>WenQuanYi Zen Hei</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>WenQuanYi Bitmap Song</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Microsoft YaHei</string> <string>Bitstream Vera Sans Mono</string> <string>DejaVu Sans Mono</string> <string>WenQuanYi Zen Hei</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>WenQuanYi Bitmap Song</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> </fontconfig>

 

 

 

你可能感兴趣的:(ubuntu,binding)