Open a pdf file programmatically at a named destination

后端 未结 5 1381
醉话见心
醉话见心 2020-12-03 15:32

I would like to open a PDF file at named destination using WinForms (C#). Here is my code:

System.Diagnostics.Process myProcess = new System.Diagnostics.Proc         


        
5条回答
  •  Happy的楠姐
    2020-12-03 16:09

    I have a csv with 5 columns. Column1 contains PDF names and Column5 pagenumbers. The executable displays the csv. When I doubleclick on a line in the csv the following code is executed :

    ListViewItem item = lvwItems.SelectedItems[0];
    Process myProcess = new Process();
    myProcess.StartInfo.FileName = "Acrobat.exe";
    myProcess.StartInfo.Arguments = "/A page=" + item.SubItems[4].Text + " " + item.Text;
    myProcess.Start();
    

    This opens the selected PDF which name is in item.Text on the page which pagenumber is in item.SubItems[4].Text

提交回复
热议问题