IrfanView automation

1.7k Views Asked by At

I'm trying to do 2 tasks with IrfranView. First, I need to grab 2 tiff images and merge them into a single tif. I'm using the command /multitif=(fileName, 1st_image, 2nd_image), but always give me an error: Error: Can't load 1st_image. After click ok, gives me the same error but for 2nd_image.

Second, I'm trying to convert a tif image to a PDF file. The code executes well, but it shows the Save Dialog Box, and I don't want it, because this is an automated and massive tool.

I'm doing this via C# code and this is my test code:

string application = @"C:\Users\joao\Desktop\iview438\i_view32.exe";
        string finalfileName = @"D:\teste\destiny\teste.pdf";
        string file1 = @"D:\teste\source\CCITT_1.TIF";
        string file2 = @"D:\teste\source\CCITT_2.TIF";


        string args = @"/multitif=(" + finalfileName + ", " + file1 + ", " + file2 + ")";
        //string argsConversion = @" " + file1 + "/advancedbatch " + "/convert= " + finalfileName + "";

        ProcessStartInfo process = new ProcessStartInfo(application, args);
        Process.Start(process);

Please, can you help me out?

Thanks

1

There are 1 best solutions below

0
On

I found the problem. There was a space between parameters that causes the problem.

For future members with this kind of situation in hands, just remove all spaces on your command, like this:

 string args = @"/multitif=(" + finalfileName + "," + file1 + "," + file2 + ")";

Thank you anyway!