Skip to content

Install on Windows

Adrian-George Bostan edited this page Mar 12, 2021 · 1 revision

Install MinGW toolchain

See installation instructions at https://github.com/adrg/go-wkhtmltopdf/wiki/Install-MinGW-toolchain.

Install wkhtmltox SDK

Download the latest installation package from https://wkhtmltopdf.org/downloads.html.

wkhtmltox download

Install wkhtmltox. In this example, the installation directory is C:\wkhtmltox.

wkhtmltox install

The header files and the pre-built library can be found in the installation directory.

wkhtmltox installation directory

Before building your project, set the CGO_LDFLAGS and the CGO_CFLAGS environment variables, in order to make the Go build tools aware of the location of the wkhtmltox SDK files.

set CGO_LDFLAGS=-L{your-sdk-path}\bin
set CGO_CFLAGS=-I{your-sdk-path}\include

In this example, the location of the SDK files is C:\wkhtmltox.

Set environment variables

Clone this wiki locally