Hi Don,
Cristof has given you the right idea here.
Couple of other things that might help:
First off Acrobat is notorious for not doing a good job of displaying dynamic URLs (ie. POSTs or Urls with querystrings) and reloading the document multiple times instead of just once. For this reason I think it's acutally better to dump your PDF to a file in a directory and then redirect to that. The Web Connection PDF sample shows how to do this.
If you do return directly, you should also add a couple of additional headers:
lcPDF = oPDF.PrintReportToString("custlist.frx")
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)
This has been the most reliable way to stream PDF directly even with the older and screwed up versions of the PDF reader.
If you're using WWWC 4.60 and you're streaming from file you can also use:
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.DownloadFile("d:\temp\somepdf.pdf","application/pdf",loHeader
FWIW, with most other types of files you don't need the custom headers so:
Response.DownloadFile("d:\temp\someword.doc","application/msword")
would be sufficient to send a file. DownloadFile was added in 4.60.
+++ Rick ---
>Hi all,
>
>I'm sure somebody has done this, but I'm a bit stumped... I need to generate a PDF on the fly and return to the web. I've tried a few samples I've seen and have been unsuccessful. So... to keep the dynamic generation of a PDF file simple, I have a simple 1 page PDF file already generated sitting in a temp folder (not visible via the //localhost or //www. addressable -- that's why it would be an inline return).
>
>So.. some items I've found are
>content-type: application/pdf
>content-disposition: inline
>content-length:
>
>and have even seen samples using boundary context and multi-part form-data components.
>
>Currently sampling with WC 4.15... I'm sure its something simple, but cant put my fingers on it...
>
>
>TIA