How to open a pdf at a named destination using AcroRd32Info in C# and VB.NET

To open a pdf at a specific page using AcroRd32Info in C# and VB.NET you can use the following snippet.

Sample C#

public static void OpenPdfAtNamedDestination(string document, string namedDestination)
{
    object myProcess = new Process();
    object startInfo = new ProcessStartInfo();
    startInfo.FileName = "AcroRd32Info.exe";
    startInfo.Arguments = string.Format(" /n /A \"pagemode=bookmarks&nameddest={0}\" \"{1}\"", namedDestination, document)
    myProcess.StartInfo = startInfo;
    myProcess.Start();
}

Sample VB.NET

Public Shared Sub OpenPdfAtNamedDestination(document As String, namedDestination As String)
    Dim myProcess As Object = New Process()
    Dim startInfo As Object = New ProcessStartInfo()
    startInfo.FileName = "AcroRd32Info.exe"
    startInfo.Arguments = String.Format(" /n /A ""pagemode=bookmarks&nameddest={0}"" ""{1}""", namedDestination, document)
    myProcess.StartInfo = startInfo
    myProcess.Start()
End Sub

One thought on “How to open a pdf at a named destination using AcroRd32Info in C# and VB.NET

Leave a Reply