Skip to content

Instantly share code, notes, and snippets.

@a4099181
Last active September 23, 2018 08:53
Show Gist options
  • Save a4099181/86224f1c1e3cb44f666266aa996d32e4 to your computer and use it in GitHub Desktop.
Save a4099181/86224f1c1e3cb44f666266aa996d32e4 to your computer and use it in GitHub Desktop.
Converts PDF into PNG for use as a chart in LES Saab 340A at X-Plane. Requirements: ImageMagick and Ghostscript must be in %PATH%. Tested on Windows 10 1803 with ImageMagick 7.0.7-7 Q16 (64-bit) and Ghostscript 9.22.
FOR %I IN (*.pdf) DO magick ^
-density 300 "%I[0]" -trim -units pixelsperinch ^
-density 300 -resize "1304x1304^" -rotate "-90>" ^
-colorspace gray -background white -flatten ^
-gravity west -extent "2048x2048" %~nI.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment