Skip to content

Instantly share code, notes, and snippets.

@chrdek
Created January 16, 2018 15:59
Show Gist options
  • Save chrdek/1616130c587b2924878627b42d4f4d0b to your computer and use it in GitHub Desktop.
Save chrdek/1616130c587b2924878627b42d4f4d0b to your computer and use it in GitHub Desktop.
PDF page slicer (by page number) using convert from imagemagick
REM Use this file to extract a specific page from a pdf..
cls
@echo off
@echo.
REM Default pdf files path..
SET pdfpath=%USERPROFILE%\Documents\mypdfs\
SET /P pagenum="Enter the pdf page you need here:"
SET /A "page=%pagenum%-1"
SET /P filename="Enter the pdf file name here:"
@echo.
convert -density 150 %pdfpath%%filename%.pdf[%page%] %pdfpath%pdfpage-%pagenum%.pdf
@echo on
@echo ...DONE! Check extracted file at %pdfpath%pdfpage-%pagenum%.pdf
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment