I am working on a C# ASP.NET web application. We have created a hyperlink which will open a PDF document. The PDF document needs to be opened inline in the browser. On Chrome on the desktop it works fine. On Chrome on android it downloads the PDF document. How can I fix it so that it will open the PDF inline on both devices?
This is my code:
var document = sessionManager.DocumentServiceClient.GetDocument(documentId, documentStorageType);
this.Response.Clear();
this.Response.ContentType = "application/pdf";
this.Response.AddHeader("Content-Disposition", string.Format("inline; filename = \"{0}.pdf\"", this.DocumentTitle));
this.Response.OutputStream.Write(document.FileData, 0, document.FileData.Length);
this.Response.End();