wkhtmltopdf 安装过程不包含php扩展部分
Qt Webkit HTML Converter
Install wkhtmltopdf
This page documents installation of wkhtmltopdf on Gentoo Linux using the patched Qt4 libraries from the wkhtmltopdf project.
Notice that portage provides media-gfx/wkhtmltopdf, but some features will be missing as the binaries are linked against the standard Qt libraries. See the wkhtmltopdf manual for further information.
Install
The destination directory will be /usr/local/wkhtmltopd, with the patched Qt 4 installed in the sub directory qt4.
Prepare source code
Download the latest source code for wkhtmltopdf:
bash$> mkdir wkhtmltopdf && cd wkhtmltopdf
bash$> wget https://github.com/wkhtmltopdf/wkhtmltopdf/archive/0.11.0_rc2.tar.gz
bash$> tar zxvf 0.11.0_rc2.tar.gz
bash$> ln -s wkhtmltopdf-0.11.0_rc2 wkhtmltopdf
Install patched Qt 4
Use git to clone the Qt repository.
bash$>yum install gstreamer-plugins-base-devel
bash$>wget https://github.com/wkhtmltopdf/qt/archive/v4.8.7.tar.gz
bash$>tar -zxvf v4.8.7.tar.gz
bash$>mv qt-4.8.7 wkhtmltopdf-qt
bash$> cd wkhtmltopdf-qt
bash$> QTDIR=../bin/syncqt
bash$> ./configure -nomake tools,examples,demos,docs,translations -opensource -prefix /usr/local/wkhtmltopdf/qt4
bash$> make -j6 && make install
Install wkhtmltopdf
With Qt installed, its time to install wkhtmltopdf.
bash$> cd wkhtmltopdf
Update QtGui.prl path in common.pri:
bash$> sed -i s%'QtGui.framework/QtGui.prl'%'libQtGui.prl'%g common.pri
Generate makefiles, build and install using QMAKE from the patched Qt installation:
export QMAKESPEC=/usr/local/wkhtmltopdf/qt4/mkspecs/linux-g++
bash$> /usr/local/wkhtmltopdf/qt4/bin/qmake
bash$> make
bash$> make install INSTALL_ROOT=/usr/local/wkhtmltopdf
Setup
For convenience, create symbolic links in /usr/local/bin and /usr/local/lib:
bash$> ( cd /usr/local/bin && ln -s ../wkhtmltopdf/bin/* . )
bash$> ( cd /usr/local/lib && ln -s ../wkhtmltopdf/lib/* . )
Update library resolve cache:
bash$> ldconfig
Test
Try out the installation with some simple example. If installed correct, there shouldn't be any complains about missing X11. If so, it's an indication that the wrong Qt libraries being used.
bash$> wkhtmltopdf toc http://www.uu.se uu.pdf
Loading pages (/)
Counting pages (/)
Loading TOC (/)
Resolving links (/)
Loading headers and footers (/)
Printing pages (/)
Done
The generated PDF-file should contain the front page and a table of content (TOC).
bash$> wkhtmltopdf http://www.baidu.com /tmp/baidu.pdf
Loading pages (/)
Counting pages (/)
Loading TOC (/)
Resolving links (/)
Loading headers and footers (/)
Printing pages (/)
Done
#遇到的错误及解决方式
#生成pdf时错误提示
wkhtmltopdf: cannot connect to X server
#解决方式
bash$> yum -y install Xvfb
bash$> xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltopdf http://www.baidu.com /tmp/baidu.pdf
注:==以上安装不包含安装php的wkhtmltopdf的扩展==。
如果中文是乱码
在目录下 /usr/share/fonts/chinese/simsun.ttc 增加该字体
wkhtmltopdf 安装过程不包含php扩展部分的更多相关文章
- centos6.5 gsoap安装过程+ php添加soap扩展
参考博客: CentOS编译安装gSOAP Linux C实现webservice调用 安装gsoap流程 里面提到make时可能碰到的问题 还没有用到 1.从官网下载最新的版本:http://so ...
- Win10 Anaconda下TensorFlow-GPU环境搭建详细教程(包含CUDA+cuDNN安装过程)(转载)
win7(win10也适用)系统安装GPU/CPU版tensorflow Win10 Anaconda下TensorFlow-GPU环境搭建详细教程(包含CUDA+cuDNN安装过程) 目录 2.配置 ...
- SQL Server 2012 Enterprise Edition安装过程详解(包含每一步设置的含义)
一.启动安装程序,点击“安装”选项卡,选择“全新SQL Server独立安装或向现有安装添加功能”.(首次安装数据库系统或向现有数据库系统添加功能,均选择此选项) 二.随后,安装程序进行“安装程序支持 ...
- Postgresql ---plv8扩展(windows下安装过程)
Postgresql下plv8安装过程其实很简单,但是在网络上搜集了半天都没有找到一篇满意的安装文档,现在总结如下: 1.下载和PostgreSQL相对应的plv8版本,下载地址如下: http:// ...
- Linux学习笔记(1)Linux虚拟机安装过程中的知识点及常用管理工具
1. VMware的相关知识 (1)建议的VMware的配置: CPU 主频1GHz以上 内存 1GB以上 硬盘 分区空闲空间8GB以上 (2)VMware创建快照 快照的作用是保存虚拟机的现有状态, ...
- memcached的安装以及php两个扩展软件安装(memcache、memcached)
百度云安装包:http://pan.baidu.com/s/1pKZeDwn k3ap 1.安装memcached Memcached是基于libevent的事件处理,所以它的安装依赖libeven ...
- 与PHP5.3.5的战斗----记php5.3.5安装过程
与PHP5.3.5的战斗----记php5.3.5安装过程 摘自:http://blog.csdn.net/lgg201/article/details/6125189这篇文章写的很是不错,,,也是我 ...
- Centos 中扩展 软件源 的安装 之 Remi ( 为yum 扩展软件源 )
平时一般都是使用Ubuntu的,最近用起来Centos 发现软件安装方便不是很方便, 在安装过程中接触到了这么一个概念, 就是为yum 安装 扩展源, 这里下面要说的就是其中的 Remi ...
- 搭建coreseek(sphinx+mmseg3)详细安装配置+php之sphinx扩展安装+php调用示例(转)
一个文档包含了安装.增量备份.扩展.api调用示例,省去了查找大量文章的时间. 搭建coreseek(sphinx+mmseg3)安装 [第一步] 先安装mmseg3 cd /var/install ...
随机推荐
- JSTLView快速国际化(SpringMVC)
JSTLView:快速国际化:只要导入了jstl的jar包,以前默认创建的InternalResouceView都会被使用jstlView替代: 国际化的新步骤: 1).写好 ...
- [2017BUAA软工]第0次作业
第0次作业 Part 1:结缘计算机 1. 你为什么选择计算机专业?你认为你的条件如何?和这些博主比呢? 我跟这篇博客中的作者相似的地方在于,我们都在一个比较早的阶段接触了计算机,我家乡的经济在全国来 ...
- Win2012r2 以及win2016 安装.NET3.5
自从微软的内核 6.2以上的版本之后 win2012 win2016 已经自带了 .net4.0的版本 但是很多应用还需要.net 3.5的版本,虽然微软的安装盘里面有 .net 3.5的安装文件,但 ...
- HTTP协议整理
一.概念 1.HTTP协议:即超文本传输协议(Hypertext transfer protocol).是一种详细规定了浏览器和Web服务器之间互相通信的规则,它允许将超文本标记语言(HTML)文档从 ...
- React 表单refs
<!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8" ...
- GIL全局解释器锁+GIL全局解释器锁vs互斥锁+定时器+线程queue+进程池与线程池(同步与异步)
以多线程为例写个互斥锁 from threading import Thread ,Lockimport timemutex = Lock() n = 100 def task(): global n ...
- python模块_hashlib详解
hashlib 摘要算法简介 Python的hashlib提供了常见的摘要算法,如MD5,SHA1等等. 什么是摘要算法呢?摘要算法又称哈希算法.散列算法.它通过一个函数,把任意长度的数据转换为一个长 ...
- apache2.4.29安装脚本
#!/bin/bash . /etc/init.d/functions yum install -y expat-devel gcc gcc-c++ zlib-devel openssl-devel ...
- 如何为TreeView定义三层模板并实现数据绑定
一直以来都想对TreeView定义多层模板,并实现数据绑定做一个总结,今天在这里做一个概述,我们常用的两层的TreeView绑定的话,我们首先修改TreeView的模板,这里我们使用的是级联的数据模板 ...
- BZOJ1926[Sdoi2010]粟粟的书架——二分答案+主席树
题目描述 幸福幼儿园 B29 班的粟粟是一个聪明机灵.乖巧可爱的小朋友,她的爱好是画画和读书,尤其喜欢 Thomas H. Co rmen 的文章.粟粟家中有一个 R行C 列的巨型书架,书架的每一个位 ...