Posted by Jim Guerber on January 16, 2006 at 15:20:22:
In Reply to: Ecomet pdf assistance posted by Chris Macfarlane on January 16, 2006 at 14:25:55:
By default, the XAP driver returns html to the browser. It tells the browser it is doing this by setting the MIME-TYPE of the document it is sending.
You want PDF to be sent to the browser. In that case, you must tell XAP NOT to set the mime type, and set the MIME type to "application/pdf" yourself.
To do this you send the following commands to the xap gateway Before any other text is sent:
A$=CONTROL(0,'TYPE 0') ! Set MIME type 0
Print 'Content-Type: application/pdf @0d0a0d0a@' ! Set MIME header for PDF
And then you can send the PDF file:
A$=CONTROL(0,'SEND filename.pdf') ! Send PDF file
For some other examples, look at lesson 19 and 20 in the xap tutorial.
Here is a page that lists the acceptable MIME types.