Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all, I am working on a web application, in which I have a help icon on some screen. All i need to do is when user click on a help icon, a pdf file of help document will open in new tab/window and this pdf should open at a particular section (i.e. should not open from page 1). Please help me out to achieve this.
Here is my code:

C#
protected void registrationHelpIcon_ServerClick(object sender, EventArgs e)
{
    try
    {
        string appBaseUrl = Request.Url.Scheme + "://" + Request.Url.Authority + Request.ApplicationPath.TrimEnd('/') + "/";
        string pdfPath = "Temp/xtLytics_security_module.pdf";
        WebClient client = new WebClient();
        Byte[] buffer = client.DownloadData(appBaseUrl + pdfPath);
        Response.ContentType = "application/pdf";
        Response.AddHeader("content-length", buffer.Length.ToString());
        Response.BinaryWrite(buffer);
    }
    catch(Exception ex)
    {
        Logger.Log(LogLevel.SystemError, ex);
    }
}


What I have tried:

I have tried many things from code project but unable to achieve the goal. Please help me out to get this pdf in new tab or window opened at particular section.
Posted
Updated 29-Sep-16 5:12am

1 solution

Adobe allows URL parameters.

Review the following documentation for more:

http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf[^]
 
Share this answer
 
Comments
Avnish_Sharma 30-Sep-16 3:32am    
Hi David, I have read that document but still not able to implement in code as I'm new to programming. So It will be a great help if you could update my code to achieve this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900