Converting CLI Command to C#

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
dbudnick
Posts: 3
Joined: 2018-06-07T20:27:18-07:00
Authentication code: 1152

Converting CLI Command to C#

Post by dbudnick »

Hi all C#.net users!

I have written the command below in the ImageMagick CLI and I would love to use it in the C#.NET but I am not sure how to convert this command. :lol:

convert t.png \(Trent - Fri2.jpg - resize 1670x1070! \) -geometry + 440 + 478 - composite Trent - Fri2.pdf


Thanks in advance.

David 8)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting CLI Command to C#

Post by fmw42 »

I cannot give C# code. But be careful. If your images have spaces in the names, you need to put quotes around the images; otherwise ImageMagick thinks you have two different images. You must also have a space between the parentheses and the command.

Code: Select all

convert t.png \( "Trent - Fri2.jpg" - resize 1670x1070! \) -geometry + 440 + 478 - composite "Trent - Fri2.pdf"
Note also writing to PDF will just put the raster image into a vector shell. It does not vectorize the raster image.
Post Reply