uw.web.pdf package

Submodules

uw.web.pdf.util module

PDF-related utility routines.

Intended to provide PDF-related utility routines for Web applications. Currently just contains a handler for running a process that produces a PDF and serving the result to the Web user agent.

uw.web.pdf.util.handle_pdf_result(process_args, title, message)[source]

Run an external process which generates a PDF result.

Parameters:

process_args – a list of arguments to the process; title – the filename for the resulting PDF file; message – message to use in case of an error.

A process is started using Popen, and the output collected.

If the process is successful, the PDF output of the process is returned along with the specified PDF title filename. Otherwise, an HTTPInternalServerError is thrown with the provided message and showing the error output from the process.

This is meant to be invoked from a WSGI handler created using wsgi.function.return_pdf.

Module contents

PDF support features.

Intended to provide PDF-related features for Web applications. Currently just contains a handler for running a process that produces a PDF and serving the result to the Web user agent.