Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Using yaml for fpdf templates

Project Description

A simple helper to create templates for fpdf in yaml.

This library allows you to define a template using yaml. The template has a few sections:

docoptions

These contain the following settings: - format (default is A4) - title - orientation (default is portrait) - author - keyword and everything else, what fpdf offers as set_x value and has only one parameter

defaults

This contains the defaults for all elements. See elements for details. This section is mandatory in case you do not set all required parameter in the elements

templates

This section is optional and allows you to reuse specific formats.

elements

Besides the former sections everything else is interpreted as element for the document. The following types are supported:

  • image (required parameter: x, y, w, h, text)
  • box (required parameter: x, y, w, h, border, optional: background, bordercolor, style)
  • rect (required parameter, same as box)
  • text (required parameter: x, y, w, h, text, font, size, optional: style, align, foreground, border, bordercolor, fill, background, multiline)

HowTo

You can simply call add_page for each page you add. By default the values of the template are use, or the values you have set before calling add page. But you can set the value for each element in the add_page call.

Release History

Release History

This version
History Node

0.6.0

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting