Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web app generates a PDF. How to show it to user
Message
 
To
23/02/2001 10:02:20
Shane Gilbert
Oklahoma State Department of Education
Norman, Oklahoma, United States
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00478375
Message ID:
00478979
Views:
23
>
>You could convert the file to a string, set the header information, and return the PDF file directly. Here is the code I use:
>
>SELECT curPDF
>lcPDF = oPDF40.PrintReportToString(Alltrim(lpReportName)+".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 is using Web Connection and Rick Strahl's wwpdf class. But if you already have a mechanism for creating the file, you should be able to convert it to a string and then send that with the appropriate header information.

Thanks for the reply.
I see what he is doing it and have seen that code before, but what I would like to know is what is being told to the browser that the text being sent back is PDF and how to handle it.
If you wrote it out as a document what would the html syntax be when the ContentTypeHeader(loHeader) is done for a application/PDF?
This is what would help me to then get my PDF text done in FoxWeb and Cold Fusion.
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform