API Method to encode a resource as cards
- Parameters:
resource - the S3Resource, or
-
the data items as list [{fieldname: representation, ...},
...], or
-
a callable that produces such a list of items
attr - additional encoding parameters (see below)
layout - the layout (a S3PDFCardLayout subclass, overrides the resource's
pdf_card_layout setting
orderby - orderby-expression for data extraction, overrides the resource's
orderby setting
labels - the labels for the fields,
-
a dict {colname: label}, or
-
a callable that produces it,
-
defaults to the labels of the extracted fields
pagesize - the PDF page size,
-
a string "A4" or "Letter", or
-
a tuple (width, height), in points
-
defaults to the layout's card size
margins - the page margins,
-
a tuple (N, E, S, W), in points, or
-
a single number, in points
-
will be computed if omitted
spacing - the spacing between cards,
-
a tuple (H, V), in points, or
-
a single number, in points
-
defaults to 18 points in both directions
title - the document title,
-
defaults to title_list crud string of the resource
- Returns:
- a handle to the output
- Overrides:
s3codec.S3Codec.encode
|