[cgiapp] Output PDF instead of HTML?

Dana Hudes dhudes at hudes.org
Tue Sep 3 01:29:06 EDT 2013


Create your PDF however you like then send a page of MIIME type x-pdf (check the exact type).  There are Perl modules for directly creating PDF as well but iit doesn't matter how your output buffer gets a PDF into it.

-----Original Message-----
From: "Jerry Kaidor" <jerry at tr2.com>
Sender: cgiapp-bounces at lists.openlib.org
Date: Mon, 2 Sep 2013 22:09:47 
To: <cgiapp at lists.openlib.org>
Reply-To: CGI Application <cgiapp at lists.openlib.org>
Subject: [cgiapp] Output PDF instead of HTML?

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 )





#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################



More information about the cgiapp mailing list