Web Connection
PDF viewed inside of the browser.
Gravatar is a globally recognized avatar based on your email address. PDF viewed inside of the browser.
  Marcel DESMET
  All
  Mar 14, 2023 @ 02:34pm

Hello, it seems that the code of your samples didn't work anymore in modern browser


loHeader = CREATEOBJECT("wwHTTPHeader")
loHeader.SetProtocol()
loHeader.SetContentType("application/pdf")
loHeader.AddHeader("Content-Length",TRANSFORM(LEN(lcPDF)))
loHeader.AddHeader("Accept-Ranges","bytes")
loHeader.AddHeader("Connection","Close")

Response.ContentTypeHeader(loHeader)
Response.Write(lcPDF)

Here is the result ( try with Firefox and Chrome )

Thank's for your help

Gravatar is a globally recognized avatar based on your email address. re: PDF viewed inside of the browser.
  Rick Strahl
  Marcel DESMET
  Mar 14, 2023 @ 05:42pm

Obsolete code from old docs... where is this from?

Don't use wwHttpHeader - all those properties and methods are on the Response object directly.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: PDF viewed inside of the browser.
  Marcel DESMET
  Rick Strahl
  Mar 15, 2023 @ 01:19am

Tks for you reply

The link in the doc is https://webconnection.west-wind.com/docs/_0lc1chayy.htm

There is also a problem with your online demo We use this way for years but now it download the pdf rather than display it in the browser

Gravatar is a globally recognized avatar based on your email address. re: PDF viewed inside of the browser.
  Rick Strahl
  Marcel DESMET
  Mar 15, 2023 @ 02:40pm

PDF display depends on browser settings. You probably changed your default PDF viewer to something other than the Web Browser.

+++ Rick ---

© 1996-2024