原文地址:
#Extracts images from a PDF file
#the images are converted to .jpg
function Extract-PDFImages($pdfPath,$imgFolder,$imgPrefix){
if (!(Test-Path $imgFolder)){
New-Item $imgFolder -ItemType Dir | Out-Null
}
$root="$imgFolder\$imgPrefix"
& 'C:\misc\PDFTools\bin32\pdfimages.exe' "-j" "$pdfPath" "$root"
}
Extract-PDFImages "c:\My.pdf" "c:\users\Administrator\Desktop\test" "img"