Windows Batch file for converting a PDF to PNG. Plus handy install script / exe of files required to get up and running.
"Installer" also added registry entries to update right click context menu.
- Download everything
- Right click install.bat
- Run as administrator
- Install Image Magick for windows https://www.imagemagick.org/
- Install ghostscript https://www.ghostscript.com/
- Edit bat file to have the location of the imagemagick install
- Move bat file to final location
- Update registry to add context menu item for PDF's
- Test it and pray
Image Magick is the exe we use to convert it. https://www.imagemagick.org/
It requires GhostScript to handle PDFs https://www.ghostscript.com/
Edit line 9 parameter 1 to point to install location of magick.exe
Move pdf2png.bat to the location you want it to stay at
Several ways to setup the registery, had problems on several machines setting it up within the HKCU but consistent results from HKCR
Create key HKEY_CLASSES_ROOT\SystemFileAssociations.pdf\shell\pdf2png give the (Default) value data of what you want your context menu to show on right click "Convert to PNG"
Create Key HKEY_CLASSES_ROOT\SystemFileAssociations.pdf\shell\pdf2png\command give the (Default) value data of ""%ProgramFiles%\pdf2png\pdf2png.bat" "%1"" Change the file path if location of bat file is different.
Right click on a PDF file
Click the context menu you've added (if it's there, it not Stack Overflow)
Licensed under the ImageMagick License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://imagemagick.org/script/license.php
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Ghostscript is made by Artifex