﻿{"id":1759,"date":"2014-06-05T19:15:39","date_gmt":"2014-06-05T11:15:39","guid":{"rendered":"http:\/\/jointd.com\/?p=1759"},"modified":"2017-10-10T09:49:54","modified_gmt":"2017-10-10T01:49:54","slug":"%e8%bd%ac%e8%bd%bd%e5%88%86%e4%ba%ab%ef%bc%9aubuntu-server%e4%b8%ad%e5%ae%89%e8%a3%85wkhtmltopdf-odoo%e6%9c%80%e6%96%b0%e7%89%88%e6%89%93%e5%8d%b0%e9%9c%80%e8%a6%81%e8%bf%99%e4%b8%aa","status":"publish","type":"post","link":"https:\/\/www.jointd.com\/?p=1759","title":{"rendered":"\u8f6c\u8f7d\u5206\u4eab\uff1aUbuntu Server\u4e2d\u5b89\u88c5wkhtmltopdf Odoo\u6700\u65b0\u7248\u6253\u5370\u9700\u8981\u8fd9\u4e2a"},"content":{"rendered":"<p>\u66f4\u65b9\u4fbf\u70b9\u7684\u65b9\u6cd5\uff1a<\/p>\n<p>Odoo 8.0 \u7248\u6539\u7528 wkhtmltopdf \u6765\u8f93\u51fa pdf\uff0c\u56e0\u6b64\u8981\u4e0b\u8f7d wkhtmltopdf \u5e76\u5b89\u88c5\u3002<br \/>\n\u5148\u4e0b\u8f7d\uff1a\uff08\u4e0b\u8fb9\u7684\u547d\u4ee4\u7b2c\u4e00\u884c\u672b\u5c3e\u7684 \/ \u548c\u7b2c\u4e8c\u884c\u5f00\u5934\u7684 w \u4e4b\u95f4\u6ca1\u6709\u7a7a\u683c )<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"php\">wget http:\/\/download.gna.org\/wkhtmltopdf\/0.12\/0.12.3\/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p>\u6216\u8005 \u53bb\u6211\u7684\u7684\u767e\u5ea6 \u7f51\u76d8\u4e0b\u8f7d<\/p>\n<p>http:\/\/pan.baidu.com\/s\/1jGLbXsy<\/p>\n<p>\u7136\u540e\u8fd0\u884c<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"php\">sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u8fdb\u884c\u5b89\u88c5\u3002<br \/>\n\u5b89\u88c5\u5b8c\u6210\u540e\u5c06\u53ef\u6267\u884c\u6587\u4ef6\u590d\u5236\u5230 usr\/bin \u4e2d<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"php\">sudo cp \/usr\/local\/bin\/wkhtmltopdf \/usr\/bin\/wkhtmltopdf<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u66f4 \u6539 \u6240 \u6709 \u8005 \u4e3a r o o t \u7528 \u6237\uff0c\u5e76 \u589e \u52a0 \u53ef \u6267 \u884c \u5c5e \u6027<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n2\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"php\">sudo chown root:root \/usr\/bin\/wkhtmltopdf\r\nsudo chmod +x \/usr\/bin\/wkhtmltopdf<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u6d4b \u8bd5 \u4e00\u4e0b\uff0c\u6253 \u5370 \u4e00 \u4e2a \u7f51 \u9875 \u5230 \u4f60 \u81ea \u5df1 \u7684 \u5bb6 \u76ee \u5f55 \uff1a<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"php\">wkhtmltopdf www.baidu.com ~\/baidu.pdf<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u5982\u679c\u663e\u793a\u6210\u529f\u8f93\u51fa\u4e86pdf \u90a3\u4e48 wkhtmltopdf \u5c31\u544a\u5b89\u88c5\u5b8c\u6210\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/vivianyw.blog.163.com\/blog\/static\/1345474222014334256367\/<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u5b89\u88c5OpenERP8.0 \u4e4b\u540e\uff0c\u4f7f\u7528\u6253\u5370\u529f\u80fd\uff0c\u63d0\u793a\u6ca1\u6709wkhtmltopdf\uff0c\u53ea\u80fd\u4ee5html\u9884\u89c8\u3002<\/p>\n<p>\u5728Ubuntu 12.04 \u5b89\u88c5wkhtmltopdf<\/p>\n<p>sudo apt-get install wkhtmltopdf<\/p>\n<p><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">\u63d0\u793aOpenERP\u9700\u8981\u81f3\u5c11wkhtmltopdf 0.12.0\uff0c\u68c0\u67e5\u5b89\u88c5\u7684wkhtmltopdf\u7684\u7248\u672c<\/span><\/p>\n<p>wkhtmltopdf -V<\/p>\n<pre>\u53ea\u5230 0.8.x\uff0cgoogle wkhtmltopdf\u53d1\u73b0\uff0cwkhtmltopdf\u7684\u4e3b\u673a\u5df2\u7ecf\u8fc1\u79fb\u5230<a href=\"http:\/\/wkhtmltopdf.org\/downloads.html\" rel=\"nofollow\">http:\/\/wkhtmltopdf.org\/downloads.html<\/a>\uff0cUbuntu\u7684\u6e90\u65e0\u6cd5\u66f4\u65b0\u3002wkhtmltopdf\u6709\u7f16\u8bd1\u597d\u7684Linux\u7248\u672c\uff0c\u627e\u5230<a href=\"http:\/\/wkhtmltopdf.org\/downloads.html\" rel=\"nofollow\">http:\/\/wkhtmltopdf.org\/downloads.html<\/a>\u4e2d\u5bf9\u5e94\u7684\u7248\u672c\uff0c\u67e5\u770b\u6253\u5305\u6587\u4ef6\u7684URL\uff0c\u4e0b\u8f7d\u7f16\u8bd1\u597d\u7684\u7248\u672c\uff1a<\/pre>\n<pre>32\u4f4d\u7248\u672c\uff1a<\/pre>\n<p>wget\u00a0http:\/\/sourceforge.net\/projects\/wkhtmltopdf\/files\/archive\/0.12.0\/wkhtmltox-linux-i386_0.12.0-03c001d.tar.xz<\/p>\n<pre>64\u4e3a\u7248\u672c\uff1a<\/pre>\n<p>wget\u00a0 http:\/\/download.gna.org\/wkhtmltopdf\/0.12\/0.12.3\/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz<\/p>\n<pre>\u89e3\u538b\u7f29\u4e0b\u8f7d\u5230\u7684\u6587\u4ef6\uff1a<\/pre>\n<p>tar -vxf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz<\/p>\n<pre>\u5f97\u5230\u4e00\u4e2a\u76ee\u5f55wkhtmltox\uff0c\u628awkhtmltopdf\u590d\u5236\u5230\/usr\/bin\u76ee\u5f55\uff0c\u66f4\u6539\u6240\u6709\u8005\uff0c\u5e76\u589e\u52a0\u53ef\u6267\u884c\u5c5e\u6027<\/pre>\n<p>&nbsp;<\/p>\n<pre>sudo cp wkhtmltox\/bin\/wkhtmltopdf \/usr\/bin\/<\/pre>\n<pre>sudo chown root:root \/usr\/bin\/wkhtmltopdf<\/pre>\n<pre>sudo chmod +x \/usr\/bin\/wkhtmltopdf\r\n\r\n\u53e6\u5916\u4e00\u4e2a\u65b9\u6cd5\uff1a\r\n\r\n<\/pre>\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n2\r\n3\r\n4\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"php\">$ wget\u00a0https:\/\/github.com\/wkhtmltopdf\/wkhtmltopdf\/releases\/download\/0.12.2.1\/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb\r\n$ sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb # \u4f1a\u63d0\u793a\u8981\u5b89\u88c5xfonts-75dpi \u7b49\uff0c\u8fd9\u65f6\u5019\u7528apt-get -f install\r\n$ sudo ln -s \/usr\/local\/bin\/wkhtmltopdf \/usr\/bin \r\n$ sudo ln -s \/usr\/local\/bin\/wkhtmltoimage \/usr\/bin<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre>\u4e0b\u9762 \u662f windows\u4e0b\u7684\u65b9\u6cd5\uff1a (2014\u5e7411\u6708\u4e4b\u540e\u7684\u7eff\u8272\u7248\u4e0d\u9700\u8981\uff09 1.\u4e0b\u8f7d\u5e76\u5b89\u88c5wkhtmltopdf\uff0c\u4e0b\u8f7d\u5730\u5740\uff1a <a class=\"bbc_link\" href=\"http:\/\/wkhtmltopdf.org\/downloads.html\" target=\"_blank\" rel=\"noopener\">http:\/\/wkhtmltopdf.org\/downloads.html<\/a> \u672c\u4ebawin7\uff0832\u4f4d\uff09\uff0cwkhtmltopdf\u5b89\u88c5\u4f4d\u7f6e\uff1aC:\\Program Files\\wkhtmltopdf 2.\u628awkhtmltopdf\u914d\u7f6e\u6210\u670d\u52a1\u3002 1)\u9700\u8981\u7528\u5230\u5de5\u5177instsrv.exe \u548c srvany.exe\uff0c\u4e0b\u8f7dWindows Server 2003 Resource Kit Tools\uff0c\u5b89\u88c5\u3002\u672c\u4eba\u5b89\u88c5\u4f4d\u7f6eC:\\Program Files\\Windows Resource Kits\u3002 2)\u5728\u5f00\u59cb\u8fd0\u884c\u91cc\u8f93\u5165CMD\u547d\u4ee4\uff0c\u8fdb\u5165dos\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\uff1a \"C:\\Program Files\\Windows Resource Kits\\Tools\\instsrv.exe\" htmltopdf \"C:\\Program Files\\Windows Resource Kits\\Tools\\srvany.exe\" 3)\u7136\u540e\uff0c\u4f1a\u53d1\u73b0\u6ce8\u518c\u8868HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\services\u4e0b\u591a\u4e86htmltopdf\u9879,\u53f3\u51fb\u5728\u5176\u4e0b\u6dfb\u52a0\u9879Parameters\uff0c\u5728Parameters\u65b0\u5efa\u5b57\u7b26\u4e32Application\u503c\u4e3aC:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltopdf.exe \u6253\u5f00\u670d\u52a1\uff08\u5f00\u59cb\u2014&gt;\u8f93\u5165services.msc,\u6216\u901a\u8fc7\u4efb\u52a1\u7ba1\u7406\u5668\u6253\u5f00\u670d\u52a1\uff09\uff0c\u542f\u52a8htmltopdf\u670d\u52a1\uff0c\u5e76\u901a\u8fc7\u201c\u53f3\u952e-&gt;\u5c5e\u6027\u201d\u628a\u542f\u52a8\u7c7b\u578b\u8bbe\u4e3a\u201c\u81ea\u52a8\u201d 3.\u5728\u73af\u5883\u53d8\u91cfPath\u91cc\u6dfb\u52a0wkhtmltopdf\u5b89\u88c5\u4f4d\u7f6e\uff08;C:\\Program Files\\wkhtmltopdf\\bin\uff09 \u91cd\u542f\u673a\u5668\uff0cok \u6ce8\uff1a\u6d4b\u8bd5htmltopdf\u670d\u52a1\u662f\u5426\u914d\u7f6e\u6210\u529f\uff0ccmd\u2014&gt;wkhtmltopdf <a class=\"bbc_link\" href=\"http:\/\/www.baidu.com\/\" target=\"_blank\" rel=\"noopener\">www.baidu.com<\/a> D:\/baidu.pdf\u00a0 ,\u67e5\u770bD\u76d8\u662f\u5426\u751f\u6210baidu.pdf \u4ee5\u4e0a\u4e0b\u8f7d\u94fe\u63a5\u53ef\u80fd\u5931\u6548\uff1a \u5b89\u88c5\uff1aapt-get install wkhtmltopdf<\/pre>\n<div>\n<p>\u4e0b\u8f7d\uff1a<\/p>\n<pre>64\u4f4d\u7248\u672c\uff1a<a href=\"http:\/\/yun.baidu.com\/share\/link?shareid=2342612474&amp;uk=1077163249\">http:\/\/yun.baidu.com\/share\/link?shareid=2342612474&amp;uk=1077163249\r\n\r\n<\/a><\/pre>\n<p>\u7528winscp \u7b49\u4e0a\u4f20 \u540e\u00a0 \u89e3\u538b\u7f29\u4e0b\u8f7d\u5230\u7684\u6587\u4ef6\uff1a<\/p>\n<p>tar -vxf wkhtmltox-linux-amd64_0.12.0-03c001d.tar.xz<\/p>\n<p>deb \u5b89\u88c5\u5305\uff1a<a href=\"http:\/\/pan.baidu.com\/s\/1jGLbXsy\">http:\/\/pan.baidu.com\/s\/1jGLbXsy<\/a><\/p>\n<pre>\u5f97\u5230\u4e00\u4e2a\u76ee\u5f55wkhtmltox\uff0c\u628awkhtmltopdf\u590d\u5236\u5230\/usr\/bin\u76ee\u5f55\uff0c\u66f4\u6539\u6240\u6709\u8005\uff0c\u5e76\u589e\u52a0\u53ef\u6267\u884c\u5c5e\u6027<\/pre>\n<p>&nbsp;<\/p>\n<pre>sudo cp wkhtmltox\/bin\/wkhtmltopdf \/usr\/bin\/<\/pre>\n<pre>sudo chown root:root \/usr\/bin\/wkhtmltopdf<\/pre>\n<pre>sudo chmod +x \/usr\/bin\/wkhtmltopdf<\/pre>\n<p>\u6d4b \u8bd5 \u4e00\u4e0b\uff0c\u6253 \u5370 \u4e00 \u4e2a \u7f51 \u9875 \u5230 \u4f60 \u81ea \u5df1 \u7684 \u5bb6 \u76ee \u5f55 \uff1a<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"php\">wkhtmltopdf www.baidu.com ~\/baidu.pdf<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u5982\u679c\u663e\u793a\u6210\u529f\u8f93\u51fa\u4e86pdf \u90a3\u4e48 wkhtmltopdf \u5c31\u544a\u5b89\u88c5\u5b8c\u6210\u3002<\/p>\n<\/div>\n<pre><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u66f4\u65b9\u4fbf\u70b9\u7684\u65b9\u6cd5\uff1a Odoo 8.0 \u7248\u6539\u7528 wkhtmltopdf \u6765\u8f93\u51fa pdf\uff0c\u56e0\u6b64\u8981\u4e0b\u8f7d wkhtmlt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[139],"tags":[170],"class_list":["post-1759","post","type-post","status-publish","format-standard","hentry","category-odoo-openerp","tag-wkhtmltopdf"],"views":6694,"_links":{"self":[{"href":"https:\/\/www.jointd.com\/index.php?rest_route=\/wp\/v2\/posts\/1759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jointd.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jointd.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jointd.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jointd.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1759"}],"version-history":[{"count":4,"href":"https:\/\/www.jointd.com\/index.php?rest_route=\/wp\/v2\/posts\/1759\/revisions"}],"predecessor-version":[{"id":3468,"href":"https:\/\/www.jointd.com\/index.php?rest_route=\/wp\/v2\/posts\/1759\/revisions\/3468"}],"wp:attachment":[{"href":"https:\/\/www.jointd.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jointd.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jointd.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}