I am taking an existing PDF file and adding some local links using the CreateLocalLink() method. It all works fine except that when I click on the link it changes the current zoom value to “Fit One Full Page to Window.” For example, if I set the zoom to 100% and then click on a link, the zoom changes to “Fit One Full Page to Window.” I don’t want it to change to this new zoom value. When I click on the link I want it to stay at the 100% (or whatever the current zoom is) that I had it set to.
Is there a way to maintain the current zoom?
Here is the code:
string outputFile = tbPDFFile5.Text;
Document finalDoc = new Document(outputFile);
var contentEditor = new PdfContentEditor();
contentEditor.BindPdf(finalDoc);
System.Drawing.Rectangle gobackTextRc1 = new System.Drawing.Rectangle(50, 725, 105, 16);
contentEditor.CreateFreeText(gobackTextRc1, “Go Back to Page 1”, 2);
contentEditor.CreateFreeText(gobackTextRc1, “Go Back to Page 1”, 2);
System.Drawing.Rectangle gobackRect1 = new System.Drawing.Rectangle(50, 725, 105, 16);
contentEditor.CreateLocalLink(gobackRect1, 1, 2, System.Drawing.Color.Red);
System.Drawing.Rectangle gobackTextRc2 = new System.Drawing.Rectangle(50, 725, 105, 16);
contentEditor.CreateFreeText(gobackTextRc2, “Go Back to Page 2”, 3);
System.Drawing.Rectangle gobackRect2 = new System.Drawing.Rectangle(50, 725, 105, 16);
contentEditor.CreateLocalLink(gobackRect2, 2, 3, System.Drawing.Color.Red);
outputFile = outputFile.Insert(outputFile.Length - 4, “_2”);
finalDoc.Save(outputFile);
I have attached a sample PDF file showing my dilemma.