Install on Windows - adrg/go-wkhtmltopdf GitHub Wiki
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.
Install wkhtmltox
. In this example, the installation directory is C:\wkhtmltox
.
The header files and the pre-built library can be found in the 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
.