httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Werner Schalk" <werner_sch...@gmx.de>
Subject RE: content length header in ExtFilterDefine
Date Fri, 23 Aug 2002 13:43:04 GMT
Hello,

well together with a friend I tried
to write an output filter which converts
text to pdf content. So I installed
ghostscript and a2ps and wrote a small
shell script which reads data from
stdin, converts to pdf and prints
this to stdout. It looks like this:
/usr/local/a2ps-4.13/bin/a2ps -q -o - |
/usr/local/ghostscript-7.05/bin/ps2pdfwr -

Then in httpd.conf I created this:
ExtFilterDefine pdfwriter mode=output intype=text/html
outtype=application/pdf PreservesContentLength
cmd="/usr/local/apache2/bin/pdfwrite.sh"
<Files *.html>
    ExtFilterOptions LogStderr DebugLevel=9
    SetOutputFilter pdfwriter
</Files>

Now I start the apache and open an example
index.html with netscape and voila he shows
me the pdf. BUT the ie just prints an empty
page instead of showing the pdf. In the
knowledgebase article is written that
"This behavior occurs because the uniform resource identifier (URI) to
the .pdf file does not end in ".pdf" (for example, the file is opened
through script or the file is dynamically generated), and the
content-type header (Multipurpose Internet Mail Extensions [MIME] type)
that is returned by the server is "unknown/unknown" or no content-length
header was returned".

And even later on:
"...To resolve this behavior, contact the Web site author or
administrator. Web site authors or administrators can resolve this
problem if they configure their Web servers to send both a content-type
header (MIME type) of "application/pdf" for .pdf files and an
appropriate content-length header".

That why I thought of sending a content-length header to the client.

The error_log shows this:
[Thu Aug 22 23:48:14 2002] [debug] mod_ext_filter.c(605): [client
192.168.0.2] filtering `/bla.html' of type `application/pdf'
 through `/usr/local/apache2/bin/pdfwrite.sh', cfg ExtFilterOptions
DebugLevel=9 LogStderr PreservesContentLength ExtFilterInT
ype text/html ExtFilterOuttype application/pdf
[Thu Aug 22 23:48:15 2002] [debug] mod_ext_filter.c(802): [client
192.168.0.2] apr_file_read(child output), len 512
[Thu Aug 22 23:48:15 2002] [debug] mod_ext_filter.c(802): [client
192.168.0.2] apr_file_read(child output), len 442
[Thu Aug 22 23:48:15 2002] [debug] mod_ext_filter.c(802): [client
192.168.0.2] apr_file_read(child output), len 2012
[Thu Aug 22 23:48:15 2002] [debug] mod_ext_filter.c(802): [client
192.168.0.2] (20514)End of file found: apr_file_read(child output), len
-1

Is there a way to implement this cool output filter
anyhow?

Bye and thanks,
Werner.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message