Install wkhtmltopdf on linux (clear and clear)

Overview

Used in company projectswkhtmltopdf to convert PDF, due towkhtmltox-0.12.5 version echarts Graphic dotted line style needs to be upgraded to wkhtmltox-0.12.6 version to resolve.

Official website address

wkhtmltopdf :https://wkhtmltopdf.org/
Insert image description here

windows installation

Download process and installation process

  1. Enter the official website:https://wkhtmltopdf.org/
  2. Click on Downloads in the upper right corner
  3. Select the windows version to download, I choose the first Installer... 64-bit
  4. After the download is complete, just click next.

Check the installed version

# 查看安装版本
wkhtmltopdf -V

PDF conversion test

stencil:

  1. wkhtmltopdf 页面路径 转换文件名称
  2. wkhtmltopdf 页面路径 /目录/转换文件名称

Screenshot operation process

Insert image description here
Insert image description here
Insert image description here

Linux installation

premise

If you have installed an old version before, you need to uninstall it first.

# 先查询安装的软件(此处为包含wkhtml)
rpm -qa |grep wkhtml  
# 卸载对应软件
rpm -e 软件名称

# 例如
rpm -e wkhtmltox-0.12.6-1.centos8.x86_64

Installation process

  • Download method: official website download, download in liunx
# liunx下载 版本:centos7 wkhtmltox-0.12.6-1 版本
wget  https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm

# liunx下载 版本:centos8 wkhtmltox-0.12.6-1 版本
wget  https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos8.x86_64.rpm
  • rpm installation: two are provided, depending on your server
# 版本:centos7 wkhtmltox-0.12.6-1 版本
rpm -ivh wkhtmltox-0.12.6-1.centos7.x86_64.rpm 
# 版本:centos8 wkhtmltox-0.12.6-1 版本
rpm -ivh wkhtmltox-0.12.6-1.centos8.x86_64.rpm
  • View version
 wkhtmltopdf -V

The test is the same as Windows, so I won’t go into details.

  • Directory location after wkhtmltopdf installation
# wkhtmltopdf 、wkhtmltoimages
cd /usr/local/bin/

Integrated use of Spring Boot, will be discussed in the next article

Guess you like

Origin blog.csdn.net/qq_44697754/article/details/132225109