{oapdf_gg}
Office software is closely linked to the PDF,the PDF is also must have to control!      Set home Page  Add to Favorites  
You are here:Home > Files to PDF > WORD to PDF
WORD to PDF
ASP.Net achieve conversion PDF format Word
Finishing by: Date:2009-04-02 14:19:07 Popularity: Tags:doc2pdf Tutorial

IV: Use C # to call ConvertDoc2PDF.js script

create a new C # the WINDOWS application, add a button button1

add a function, function names StartConvertPDF

public void StartConvertPDF ()

(

Process proc = new Process ();

proc.StartInfo.FileName = "cmd.exe";

proc.StartInfo.WorkingDirectory = @ "c: \";

proc.StartInfo.CreateNoWindow = true;

proc.StartInfo.UseShellExecute = false;

proc.StartInfo.RedirectStandardInput = true; //input redirection

proc.Start ();

proc.StandardInput.WriteLine (@ "cscript //nologo c:\ConvertDoc2PDF.js c:\test.doc c: \");

proc.StandardInput.WriteLine ( "exit");

proc.WaitForExit ();

)

then CLICK the button to add the incident to call the code thread

private void button1_Click (object sender, System.EventArgs e)

(

//definition of line procedures

Thread thConvert = new Thread (new ThreadStart (StartConvertData));

thConvert.Start ();

)

Note: In testing the above C # program, it is important to add the following namespace

using System.Diagnostics;

using System.Threading;

there isArticle InformationsComment Information
Category column

Site Help | Site Map | Feedback |
OAPDF.COM Copyright 2009 V1.1