Converting TIF images to PDF by passing .exe file with its aruments
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Converting TIF images to PDF by passing .exe file with its aruments

  1. #1
    Join Date
    Jan 2011
    Posts
    1

    Converting TIF images to PDF by passing .exe file with its aruments

    I have one .exe file which converts *.tif images into *.pdf file. And i have one class library where i need to pass this .exe file with its arguments. Here arguments i need to pass are scalesector, outputpath (path to generate pdf file) and inputpath (path where tif image exists).
    Here i have big tif images like its height will be more than 60,000. So i need to achieve it in C#.

    I have written the code as below.

    But i am unable to get the PDF in output directory. What may be the problem?
    When i checked Output directory will be empty.

    private void converttopdf()
    {
    ProcessStartInfo startInfo = new ProcessStartInfo();
    startInfo.FileName = "E:\\pdfbigimage_src\\Debug\\pdfbigimage.exe";
    startInfo.Arguments = "-s 0.4 -o E:\\output\\out9.pdf E:\\Input_Images\\SI00004623\\2010026567_001.tif";
    startInfo.Verb = null;
    startInfo.RedirectStandardOutput = true;
    startInfo.UseShellExecute = false;
    startInfo.WindowStyle = ProcessWindowStyle.Hidden;
    Process.Start(startInfo);
    }

  2. #2
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,005

    Re: Converting TIF images to PDF by passing .exe file with its aruments

    Nothing seems obviously wrong with your code (to my single read through), but that doesn't mean something isn't wrong (since obviously it is: it doesn't work :-)).

    More realistically though, using C# for this task is a bit overkill. I recommend you use either batch programming (if you're using windows) or shell scripting (if a linux-like environment).

    Resource for batch files: http://www.ericphelps.com/batch/

    It isn't very hard to learn and it's a handy tool to have available. You know what they say... when all you have is C#, everything looks like ... problem that can be solved by C#.. (erm.. right?)
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center