Using info found here and elsewhere I have successfully implemented an app that will pull a PDF from our document storage server, stream it across our firewall and display it in a frame on the client's web browser. The PDF is loaded into a page using the following code and that page is the source for the iframe.
int ImageID;
if (int.TryParse(Request.QueryString["ImageID"], out ImageID))
{
FileTransferService.FileTransferClient client = new FileTransferService.FileTransferClient();
Byte[] documentStream = client.GetFile(Classes.AppSettings.pwServer, Classes.AppSettings.pwDatabase, Classes.AppSettings.pwUsername, Classes.AppSettings.pwPassword, Classes.AppSettings.pwCabinet, ImageID, "", "");
Response.ContentType = "application/pdf";
Response.BinaryWrite(documentStream);
}
This is working fine most of the time, but due to settings on the client for the Acrobat Reader plugin the PDF will sometimes open in Acrobat Reader rather than displaying in the web page, leaving our page with an empty hole where the PDF should be. I've searched for a third party PDF viewer we could use in the app without success. Either they don't accept a stream as a source or the image quality is unacceptable. If we could force it to always pop up in Acrobat Reader that would be acceptable, but we'd prefer it to be displayed in the web page. For security reasons we don't want to write the file to disk and display it from there.
Is there a method to force the viewing behavior one way or another or a third party viewer we could use that will solve this problem?