Skip to main content

Module print

Module print 

Source
Expand description

Printing: Page Setup, pagination and PDF output (File › Print, File › Export › PDF).

Sheets are paginated like Excel: the print area (or the used range plus drawing objects) is split into bands of rows and columns that fit the printable area at the page scale, honouring manual breaks, repeated title rows/columns, headings, Fit To and centring, and the pages follow the sheet’s page order (“down, then over” by default, or “over, then down”). Each page is drawn into a PDF with gridcraft-pdf: fills, gridlines, borders, formatted text (fonts mapped to the standard 14 PDF fonts), merged cells, wrapping, overflow into empty neighbours, conditional formats, table styles, charts, images, shapes and sparklines. Headers and footers support &L/&C/&R sections and the &P &N &D &T &A &F &Z codes.

Structs§

HfContext
Values for header/footer codes.
HfSection
One header/footer section: its text and whether &B made it bold.
PrintOptions
Options shared by the print commands.
SheetLayout
The pagination of one sheet.

Constants§

HF_FIELDS
Header/footer codes and the field names the Page Layout view shows for them while editing.
MAX_PAGES
Most pages one export produces.

Functions§

codes_to_fields
A raw section as the user edits it: &P shows as &[Page], &N as &[Pages], and so on.
expand_header_footer
Expands a header/footer string into its left, centre and right sections.
fields_to_codes
The inverse of codes_to_fields: field names become codes again; a dangling & at the end becomes a literal ampersand so it can’t swallow the next section’s code.
hf_date_time
Today’s date and the current time as headers and footers show them (&D, &T).
join_header_footer
Joins raw left, centre and right sections into one header/footer string.
layout_sheet
Paginates one sheet.
layouts
Lays out every sheet a print command covers.
paper_size
Paper size in points (portrait) for a paper name; unknown names fall back to Letter.
print_range
The range a sheet prints: its print area, else the used range grown to cover drawing objects. None when there is nothing to print.
render_pdf
Renders laid-out sheets to a PDF.
specs
split_header_footer
Splits a header/footer string into its raw left, centre and right sections (codes kept). Text before the first &L/&C/&R belongs to the centre, as when printing.