Page 1 of 1

Image to PDF and crop

Posted: 2019-09-04T18:05:04-07:00
by hacnsteein
Trying to convert a PDf to jpg and crop the jpg on Win 10. Got this to work:

Code: Select all

convert -density 200 test.pdf -quality 100 test.jpg \ -crop 1385x690+50+0 output.jpg
but the cmd window has errors like

Code: Select all

unable to open image 'test.jpg' : no such file or directory @ error/blob.c/OpenBlob/3497

unable to open image '\' : no such file or directory @ error/blob.c/OpenBlob/3497

unable to open image '\' : no such file or directory @ error/blob.c/OpenBlob/3497

no decode delegate for this image format '' @error/constitute/ReadImage/556.
Should this be ignored? I mean it works?

Re: Image to PDF and crop

Posted: 2019-09-04T19:49:32-07:00
by fmw42
Your syntax is wrong. There is no \ for end of line in Windows. It is ^.

Your second part has no input. So either remove the \ and test.jpg to read

Code: Select all

convert -density 200 test.pdf -crop 1385x690+50+0 -quality 100 output.jpg
or two lines with end of line ^ character

Code: Select all

convert -density 200 test.pdf -quality 100 ^
-crop 1385x690+50+0 output.jpg
or

Code: Select all

convert -density 200 test.pdf -quality 100 test.jpg
convert test.jpg -crop 1385x690+50+0 output.jpg