The response.write won't work after the document is streamed anyway. Do you want to create a .pdf file on the fly or to stream an existing file?
FtB
Main Topics
Browse All TopicsHere is the code i have on a page...
<%
Response.AddHeader "Content-Disposition", "attachment; filename=PressRelease.pdf"
Response.ContentType = "application/pdf"
Response.Write("I am here")
%>
when i try to open it, it opens Acrobat Reader but the Acrobat Reader gives me an error in the form of a message box with this message "Acrobat could not open 'PressRelease[1].pdf' because it is either not a supported file type or because the file has been corrupted (for example, it was sent as an email attachment and wasn't correctly decoded)."
Any ideas?
:) SD
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
displaying a pdf
<% option explicit %>
<%
Response.Clear
Response.ContentType="appl
Response.AddHeader "content-type", "application/pdf"
Response.Buffer = True
Dim oXMLHttp
Set oXMLHttp = Server.CreateObject("MSXML
oXMLHttp.Open "GET", "http://127.0.0.1/PressRel
oXMLHttp.Send
Response.BinaryWrite oXMLHttp.ResponseBody
Set oXMLHttp = Nothing
%>
attachment???
Read this
http://support.microsoft.c
hongjun
Thanks for the feedback folks,
What i really wanted to do was... create a PDF file on the fly. i.e. convert an ASP page into a PDF.
You can convert aSP files into word, excel etc, by changing the response.contenttype. I was able to convert it into PDF similarly in the past. But now, i am having trouble.
Ftb, Do you want to create a .pdf file on the fly? Yes.
AgentSmith007, your method sounds complicated, is there a simpler solution?
hongjun, I am trying to create a PDF on the fly and not stream an existing PDF. Thank you.
:) SD
AgentSmith is right. You can find some examples of such components at:
http://www.aspin.com/home/
http://www.websupergoo.com
We are using a product from activePDF called Webgrabber which allows us to dynamically create a pdf from an asp page. It is excellent. But it is a third party component not sure if this is what you are looking for.
www.activepdf.com
Business Accounts
Answer for Membership
by: AgentSmith007Posted on 2004-12-11 at 17:09:12ID: 12802059
I don't think it's just that easy to dynamically generate a PDF file. Here's a page I found that might help you or possibly point you in the right direction:
ssue/99090 2.htm
http://www.15seconds.com/i