Open a pdf file programmatically at a named destination

后端 未结 5 1374
醉话见心
醉话见心 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条回答
  •  無奈伤痛
    2020-12-03 16:14

    Regarding the Adobe documentation when opening a PDF document from a command shell, you can pass the parameters to the open command using the /A switch using the following syntax:

    myProcess.StartInfo.Arguments = "/A \"nameddest=Test2=OpenActions\" C:\\example.pdf";
    

    If I omit the OpenActions parameter everything works fine like:

    myProcess.StartInfo.Arguments = "/A \"nameddest=Test2\" C:\\example.pdf";
    

    I'm not sure why the OpenActions breaks opening the file but with omitting it works fine.

提交回复
热议问题