[Catalyst] Fwd: Catalyst::View::PDF::Reuse generates empty PDF
victorchurchill at gmail.com
Fri Mar 4 13:37:42 GMT 2011
On 4 March 2011 08:36, Jorge Gonzalez <jorge.gonzalez at daikon.es> wrote:
> If you do another prFile, the Catalyst one gests closed, and you get
> nothing, as you are writing somewhere else which Catalyst knows nothing
> With "pdf_filename" in the stash you specify the filename that will be sent
> *to the browser* as the preferred name for the attachment, instead of
> letting the browser generate one automatically. What error do you get if you
> don't specify it?
Error between keyboard and chair ;-)
My mistake, I had been seeing a 'file not found' error, which I
associated with the absence of the pdf_filename. But now, from a
working setup, omitting the pdf_filename results in a PDF file being
generated with a CVPR-generated default (as per the docs).
> The PDF on the server is spit out on stdout, following the normal Catalyst
> information flow (and sent to the browser).
> OTH, specifying the output filename with prFile, when you are using the
> module from a web application framework seems a bad idea to me. Input and
> output are being hanlded somewhere else... (i.e. Catalyst).
That all makes good sense.
> Nowhere in the
> docs of CVPR states that you have to use prFile to generate the PDF.
Equally, nowhere did it say you don't ;-) And the PDF::Reuse docs are
quite categorical about it being mandatory so I made the error of
assuming that it would be required in the Catalyst use case.
> prFile must be used when you are using PDF::Reuse on a standalone script, as
> a mean of getting the generated PDF on disk. But with CVPR, the PDF gets
> output directly to stdout (Catalyst handles that!). You just have to design
> your PDF, Catalys does everything else for you.
Yes, when it all works it is indistinguishable from magic ;-) But when
it is not quite set up right it can be quite hard to see what is going
wrong. I need to get some experience in Catalyst's logging, debugging
and tracing techniques.
More information about the Catalyst