Image to PDF and crop

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
hacnsteein
Posts: 1
Joined: 2019-09-04T17:52:23-07:00
Authentication code: 1152

Image to PDF and crop

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image to PDF and crop

Post 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
Post Reply