pdf with webspeed on IIS - CR/LF problem

Chris Kelleher

Administrator
Staff member
Hi!

We are using IIS on some of our web servers (that's a must, sorry). We
use the code which had been posted before to put a PDF file directly to
the webstream. The actual code is put at the end of this letter.

The problem we occur is that before every LF a CR is inserted (which is
the DOS convention). But we teste to direct the output to annother file
(using a named output stream). That output file has the same size as the
original size, so I think the algorithm is correct. The same code is
running perfectly on an AIX box.

Setting a link to the created PDF file and clicking on the link works
perfect.

Does anybody know about that behavior and how to change it. Or are my
thoughts wrong? Any help welcome.

Configuration: WS 2.1, cgiip.exe, NT 4.0 with SP 5, IIS 4

Klaus Erichsen

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
def var vfileline as raw no-undo.

output-content-type ("application/pdf":U).

input stream inputfile from value(fOut) binary no-echo no-map
no-convert.
repeat:
length(vfileline) = 1024.
import stream inputfile unformatted vfileline.
put {&WEBSTREAM} control vfileline.
end.

length(vfileline) = 0.
input stream inputfile close.
[/code]
 

Chris Kelleher

Administrator
Staff member
Instead of output-content-type ("application/pdf":U).
try this:

{&out} "Content-type: application/pdf~n~n".

This should work on NT. Let me know.
 

Chris Kelleher

Administrator
Staff member
I've responded privately to Klaus, but am sending this out to the peg so we
can stop trying to solve this. This is a bug in the CGIIP messenger on NT.
We didn't open stdout in binary mode, so the C runtime translates CRs for
us. It is fixed in 9.1a and suggested Klaus open up a call to tech support
for a patch should he want one.

David Cleary
Progress Software
 

Chris Kelleher

Administrator
Staff member
Do we have the same problem in 2.1 cgiip on NT? I noticed that with
HPUX/WSNSA.dll WS 2.1, there is the same problem, but CGIIP on that
platform works.

Can we have some patches for 2.1?

(or source-code... we'll settle for that!)

--
Steve Southwell
Web Programmer / Consultant
United Systems, Inc. http://www.usiatl.com
Phone: (214) 488-2239
 

Chris Kelleher

Administrator
Staff member
Is the code below in the output-headers (or output-header for mapped-HTML)
procedure? If not, the output-content-type function must be there.

I have had it work with the input/output code outside of output-headers but
I've never tried it with everything inside the procedure. If you want to have
everything inside of the output-headers procedure, you might try adding
output-http-header("","") just before the input/output code. I believe HTML
wants a blank line after the HTTP headers.

__________________________________
Tony Auerbach
Application Solutions Specialist
SCS
(972) 550-7666 Ext. 2132
auerbaa@ccgate.dl.nec.com http://www.scsglobal.com
 
Top