Is this possible to open PDF file with exists Bookmarks on a specific one, programmatically on C# (It's OK for me to work with ItextSharp, if there a way)?
I followed this question and it's work for destination not for bookmarks.
Another alternative that could work for me is to configure destination with Word 2007, so after the converting to PDF with Acrobat reader the Destinations and their name will save.
Thanks for help!
EDIT 1
This is my code : (Click on button 1 write all the bookmarks to a combobox)
private void button1_Click(object sender, EventArgs e)
{
reader = new PdfReader("C:\\Users\\itay\\Desktop\\V-Sperm Gold 3.49 User Guide_04_APR_11.pdf");
book_mark = SimpleBookmark.GetBookmark(reader);
foreach (Dictionary<string, object> bk in book_mark)
{
foreach (KeyValuePair<string, object> kvr in bk)
{
if (kvr.Key == "Kids" || kvr.Key == "kids")
{
IList<Dictionary<string, object>> child =
(IList<Dictionary<string, object>>)kvr.Value;
recursive_search(child, tn);
}
else if (kvr.Key == "Title" || kvr.Key == "title")
{
tn = new System.Windows.Forms.TreeNode(kvr.Value.ToString());
//comboBox1.Items.Add(tn.Text);
}
else if (kvr.Key == "Page" || kvr.Key == "page")
{
//saves page number
tn.ToolTipText = Regex.Match(kvr.Value.ToString(), "[0-9]+").Value;
}
}
}
}
public void recursive_search(IList<Dictionary<string, object>> ilist, TreeNode tnt)
{
foreach (Dictionary<string, object> bk in ilist)
{
foreach (KeyValuePair<string, object> kvr in bk)
{
if (kvr.Key == "Kids" || kvr.Key == "kids")
{
IList<Dictionary<string, object>> child =
(IList<Dictionary<string, object>>)kvr.Value;
recursive_search(child, tn);
}
else if (kvr.Key == "Title" || kvr.Key == "title")
{
tn = new System.Windows.Forms.TreeNode(kvr.Value.ToString());
comboBox1.Items.Add(tn.Text);
}
else if (kvr.Key == "Page" || kvr.Key == "page")
{
tn.ToolTipText = Regex.Match(kvr.Value.ToString(), "[0-9]+").Value;
tnt.Nodes.Add(tn);
}
}
}
}
Click on Button 2 open the PDF :
private void button2_Click(object sender, EventArgs e)
{
Process myProcess = new Process();
myProcess.StartInfo.FileName = "AcroRd32.exe";
myProcess.StartInfo.Arguments = "pagemode=bookmarks&nameddest=" + comboBox1.Text + "\" \"" + "C:\\Users\\itay\\Desktop\\V-Sperm Gold 3.49 User Guide_04_APR_11.pdf" + "\"";
myProcess.Start();
}