"""
    MoinMoin - Render as PDF action - redirects to the PDF formatter

    @copyright: 2006 Gerald Manipon
    @license: GNU GPL, see COPYING for details.
"""

from MoinMoin.Page import Page
from MoinMoin.util import MoinMoinNoFooter

def execute(pagename, request):
    url = Page(request, pagename).url(request, {'action': 'format',
                                                'mimetype': 'application/pdf'}, 0)
    request.http_redirect(url)
    raise MoinMoinNoFooter
