Cut+paste from two regions of one image..
Posted: 2014-07-02T08:49:40-07:00
Hi everybody --
So I have a time-pressed project that's giving me huge headaches.. I've searched the forums and have tried so many different ways to accomplish this, but I'm just stuck. I'm trying to go thru all pdfs in a folder, convert to jpg and rotate 90 degrees., then I need to cut and paste two small regions of that jpg onto the same image, and finally crop and resize it. I have the following batch file (latest attempt):
But oddly, the echo "Converting" doesn't even show; it immediately displays the error "-geometry was unexpected at this time." I'm really at a wall trying to figure out how to make this happen, and my boss is getting impatient. Can anyone lend a hand on this? Thanks..
So I have a time-pressed project that's giving me huge headaches.. I've searched the forums and have tried so many different ways to accomplish this, but I'm just stuck. I'm trying to go thru all pdfs in a folder, convert to jpg and rotate 90 degrees., then I need to cut and paste two small regions of that jpg onto the same image, and finally crop and resize it. I have the following batch file (latest attempt):
Code: Select all
@ECHO OFF
FOR %%f IN ("C:\EKG_Images\*.pdf") DO (
ECHO.Converting %%f...
.\im\convert -density 400 -rotate 90 "%%f" "C:\EKG_Images\%%~nf.jpg"
IF EXIST "C:\EKG_Images\%%~nf.jpg" (
ECHO.Relocating sidebars...
.\im\convert "C:\EKG_Images\%%~nf.jpg" ( +clone -crop 60x3800+40+75 ) -geometry +170+90 ( +clone -crop 60x620+3340+3700 ) -geometry +170+3600 -composite "C:\EKG_Images\%%~nf.jpg"
ECHO.Cropping and resizing JPG...
.\convert "C:\EKG_Images\%%~nf.jpg" -crop 3190x4200+140+60 -density 400 -resize 2700 "C:\EKG_Images\%%~nf.jpg"
) ELSE (
ECHO.*** ERROR *** Could not convert pdf to jpg.
GOTO done
)
)
ECHO.
:done
ECHO.Done.