[cgiapp] Output PDF instead of HTML?

Jerry Kaidor jerry at tr2.com
Tue Sep 3 01:09:47 EDT 2013


Hello,

   I have an application I've been writing and using now for some years,
in support of my business.  I use CGI::Application, and the login and
authentication plugins.

   It sometimes would be nice to be able to serve PDF data instead of
HTML.  These are not disk files: they are PDF reports that are
algorithmically generated.  ( Generally, I use perl to generate TeX and
convert it to PDF with pdflatex ).

   I have done some web searching, and nothing jumps out at me, with the
possible exception of something in CGI.pm about being able to specify
different or custom headers.   When I try that, the "custom headers" wind up
as text inside an html wrapper.   Quite useless.

   Is there something about CGI::Application and the login plugin that
restricts output to HTML?

   I suppose I could try redirection:  user clicks on the "create a PDF"
link, the system responds by creating the PDF, storing it on disk in a
temp location, and returning a browser redirect to make the browser get
the temp file.  Ick.

                     - Jerry Kaidor ( jerry at tr2.com )






More information about the cgiapp mailing list