Forum  General Visual ...  Let's Chat Abou...  Embedding PDFs - odd behavior
Previous Previous
 
Next Next
New Post 12/2/2009 12:38 PM
  msawczyn
190 posts
5th Level Poster


Embedding PDFs - odd behavior 

 Everyone,

I have an HtmlBox to which I'm streaming the bytes of a pdf via the form's gateway handler. The relevant code is:

      protected override IGatewayHandler ProcessGatewayRequest(System.Web.HttpContext httpContext, string action)
      {
         switch (action)
         {
            case "Document":
               if (SelectedDocument != null)
               {
                  httpContext.Response.ContentType = SelectedDocument.MimeType;
                  httpContext.Response.BinaryWrite(SelectedDocument.Data);
                  httpContext.Response.End();
               }
               break;
         }

         return null;
      }

When I run this from my local visual studio webserver, the pdf is displayed embedded in the HtmlBox. Yet when this is deployed to IIS, the pdf opens in an instance of Acrobat reader external to the browser. Same code, yet different behavior. The proper mime type is being sent.

Anyone seen this before and solved it? Any thoughts as to why this is happening? The desired behavior is to have it embedded in the HtmlBox.

Thanks.

-- Michael

 
New Post 12/2/2009 5:47 PM
  gcsorensen
204 posts
4th Level Poster


Re: Embedding PDFs - odd behavior 

Hi, Michael,

If the issue is occuring on the same client i.e. your dev machine, then I haven't seen this behaviour.

If the issue occurs on a different client then its most likely that the Adobe Reader is configured to open 'Internet' PDFs in a separate window.  You could check on the Edit\Preferences\Internet menu\dialog in Reader and see in "Web Browser Options" if the "Display PDF in Browser" checkbox is checked.  If this setting is unchecked, then you will see the behaviour you describe.

HTH,
Geoff

 
New Post 12/3/2009 4:55 AM
  msawczyn
190 posts
5th Level Poster


Re: Embedding PDFs - odd behavior 

Unfortunately, this behavior is indeed occurring on the development machine, along with other machines. I've checked the setting you mentioned and it's set to open in the browser. Rats.

I'm wondering if it's not a VWG issue. I've found that we have another website. on the same web server, that has the same code and displays PDFs in an embedded HtmlBox (in a splitter, also the same) that consistently shows the PDF in the HtmlBox. Quite odd. The IIS settings on both websites are identical.

If anyone has a clue, I'd be eternally grateful.

-- Michael

 

 
New Post 12/3/2009 5:16 AM
  ori.cohen
4401 posts
1st Level Poster




Re: Embedding PDFs - odd behavior 

Hello Michael,

In addition to Geoff's suggestion, there is a way to configure this in the registry per extension for each browser.
I am referring to the registry of the client machines of course.

Regards,

Ori Cohen
Support Manager, the Visual WebGui team

 
New Post 12/9/2009 3:10 AM
  gcsorensen
204 posts
4th Level Poster


Re: Embedding PDFs - odd behavior 

Hi again, Michael,

When I saw this issue it was in a corporate environment, where updates are distributed/controlled by some other process that applications self-updating.

In a couple of cases, I was unable to restore the desired behaviour, and  I had to wait for the version of Adobe reader to be upgraded (to V8.x I think) by this process.

Perhaps the version of Adobe reader has this type of issue.  On those machines where I waited, the registry key edit you can find with a quick google had no effect, and in one case even caused the external display, but this was not reversible by restoring the registry key, and that machine was stuck until the upgrade!

Good luck,
Geoff

 
Previous Previous
 
Next Next
  Forum  General Visual ...  Let's Chat Abou...  Embedding PDFs - odd behavior
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS