Introduction
wkhtmltopdf does not yet have official prebuilt binary for Apple Silicone, but intel based applications can still be installed and ran using Rosetta 2, which acts as an emulator, translating x86_64 instructions into ARM64 instructions, enabling running intel x86_64 bit applications on ARM64 architecture.
Installing Rosetta 2
Rosetta can be installed using the terminal by running the following command:
softwareupdate --install-rosetta --agree-to-license
Installing wkhtmltopdf
With Rosetta installed we should be able to install wkhtmltopdf 64-bit architecture. Go to the official wkhtmltopdf page and download the 64-bit MacOS installer, right click on the downloaded .pkg installer, click open and proceed with the default installation.
Restart your application which requires wkhtmltopdf and it should be able to convert html page to pdf files.
Running the Terminal using Rosetta (Recommended)
If you are planning to use the terminal to install 64-bit application then you can open the terminal using Rosetta by doing the following:
- Open Finder > Applications > Utilities.
- Right click on the Terminal and click Get info.
- Check the option for Open using Rosetta.
Check what archetecture the terminal is using by launching it and running the following command:
arch
If the result is x86_64 or i386 then you are using the Rosetta emulator correctly.