我看用 wkhtmltopdf 来实现正合适,而且提供了 Windows、Linux 和 Mac 平台上的版本。
该工具的详细参数如下:
General Options:
--crop-h <int> Set height for croping
--crop-w <int> Set width for croping
--crop-x <int> Set x coordinate for croping
--crop-y <int> Set y coordinate for croping
-H, --extended-help Display more extensive help, detailing less common command switches
-f, --format <format> Output file format (default is jpg)
-h, --help Display help
--quality <int> Output image quality (between 0 and 100) (default 94)
-V, --version Output version information an exit
--width <int> Set screen width (default is 1024) (default 1024)