Skip to main content

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yafte-0.7.1.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file yafte-0.7.1.tar.gz.

File metadata

  • Download URL: yafte-0.7.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for yafte-0.7.1.tar.gz
Algorithm Hash digest
SHA256 12e520448e8561156f138140511fd39aabafbac1aa25d8ce3b5e39e66953e492
MD5 cef8610fdc07f8b38ce1ff794d748777
BLAKE2b-256 c4976769263dd7a9ec94dcc06e1deb0bb026e004e58304108846b9ab05d01cb0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page