<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[Linux-CentOS 安装 Unoconv]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[服务器技术]]></category>
<pubDate>Sat, 16 Feb 2019 08:57:41 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	因业务需要，需要将html 和其它格式文件转换为 pdf格式，故需要以下方面支持<br/><br/>安装 liboffice<br/><br/>到 <a href="http://www.libreoffice.org/download/" target="_blank">http://www.libreoffice.org/download/</a> 找到对应的版本<br/><br/>以 centos 7 64位服务器为例 下载&nbsp;&nbsp;最新的 64位版本的 rpm包<br/><br/><br/><br/>点击 download 后稍等一会 会自动下载<br/><br/><a href="https://www.libreoffice.org/donate/dl/rpm-x86_64/6.1.2/zh-CN/LibreOffice_6.1.2_Linux_x86-64_rpm.tar.gz" target="_blank">https://www.libreoffice.org/donate/dl/rpm-x86_64/6.1.2/zh-CN/LibreOffice_6.1.2_Linux_x86-64_rpm.tar.gz</a><br/><br/>也可以在下载页自己找速度较快的镜像地址下载<br/><br/>直接在服务器命令行 wget <a href="https://www.libreoffice.org/donate/dl/rpm-x86_64/6.1.2/zh-CN/LibreOffice_6.1.2_Linux_x86-64_rpm.tar.gz&nbsp;&nbsp;" target="_blank">https://www.libreoffice.org/donate/dl/rpm-x86_64/6.1.2/zh-CN/LibreOffice_6.1.2_Linux_x86-64_rpm.tar.gz&nbsp;&nbsp;</a>也可以下载<br/><br/>下载完成后解压缩<br/><div class="code"><br/>tar -zxvf LibreOffice_6.1.2_Linux_x86-64_rpm.tar.gz<br/></div><br/>进入到 解压后目录 cd LibreOffice_6.1.2.1_Linux_x86-64_rpm<br/><br/>进入到 RPM包目录 cd RPMS<br/><br/>安装所有rpm包<br/><div class="code"><br/>rpm -ivh *.rpm<br/><br/>yum install *.rpm<br/></div><br/>安装完成后，下载 unovocn ，git地址 <a href="https://github.com/dagwieers/unoconv" target="_blank">https://github.com/dagwieers/unoconv</a><br/><br/>依然使用 wget 下载 wget <a href="https://github.com/dagwieers/unoconv/archive/master.zip" target="_blank">https://github.com/dagwieers/unoconv/archive/master.zip</a><br/><br/>下载后 unzip master.zip 即可<br/><br/>进入解压后的 unoconv-master 目录 运行 unoconv -f pdf CHANGELOG.md 来测试，会报错<br/><div class="code"><br/>/usr/lib64/libreoffice/program/soffice.bin X11 error: Can’t open display:<br/>Set DISPLAY environment variable, use -display option<br/>or check permissions of your X-Server<br/>(See “man X” resp. “man xhost” for details)<br/></div><br/> <br/><br/>网上查了一下 需要安装一些别的软件就可以&nbsp;&nbsp;yum install libreoffice-headless&nbsp;&nbsp;用这个命令安装好这些依赖即可<br/><br/>再运行&nbsp;&nbsp;unoconv -f pdf CHANGELOG.md 即可看到同目录已经生成了 相应的pdf文件<br/><br/>=======================<br/>unzip master.zip<br/>cd unoconv-master<br/>mkdir /usr/local/unoconv/<br/>mv * /usr/local/unoconv/<br/>ln -s /usr/local/unoconv/unoconv /usr/bin/unoconv<br/>===================<br/>乱码问题<br/><br/>将Windows下的Fonts，如：C:&#92;Windows&#92;Fonts，压缩成Fonts.zip压缩包。<br/><br/>将压缩包拷贝到Linux目录下，执行如下命令即可：<br/><br/>unzip Fonts.zip<br/>mkdir /usr/share/fonts/win<br/>cp Fonts/* /usr/share/fonts/win<br/>cd /usr/share/fonts/win<br/>chmod&nbsp;&nbsp;-Rf 755 *<br/>mkfontscale&nbsp;&nbsp;<br/>mkfontdir&nbsp;&nbsp;<br/>fc-cache –fv&nbsp;&nbsp;<br/><br/>但是，当我们执行 mkfontscale 的时候发现，居然提示没有这个命令，<br/><br/>所以，<br/><br/>如果提示 mkfontscale: command not found，需安装&nbsp;&nbsp; yum install mkfontscale <br/>如果提示 fc-cache: command not found，需安装&nbsp;&nbsp;yum install fontconfig<br/><br/>重启服务器就好了<br/><br/>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] Linux-CentOS 安装 Unoconv]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>