CtrlO-PDF

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

## margin\_top

Sets or returns the top margin. Defaults to the margin + top\_padding +
room for the header (if defined) + room for the logo (if defined).

## margin\_bottom

Sets or returns the bottom margin. Defaults to the margin + room for the
footer.

## top\_padding

Sets or returns the top padding (additional to the margin). Default 0.

## header

Sets or returns the header text.

## footer

Sets or returns the footer text. Page numbers are added automatically.

## font

Sets or returns the font. This is based on PDF::Builder or PDF::API2 ttfont,
which returns a TrueType or OpenType font object. By default it assumes the
font is available in the exact path
`truetype/liberation/LiberationSans-Regular.ttf`. A future
version may make this more flexible.

## fontbold

As font, but a bold font.

## logo

The path to a logo to include in the top-right corner of every page (optional).

## logo\_scaling

The scaling of the logo. For best results a setting of 0.5 is recommended (the
default).

## logo\_padding

The padding below the logo before the text. Defaults to 10 pixels.

## y\_position

Returns the current y position on the page. This value updates as the page is
written to, and is the location that content will be positioned at the next
write. Note that the value is measured from the bottom of the page.

## set\_y\_position($pixels)

Sets the current Y position. See ["y\_position"](#y_position).

## move\_y\_position($pixels)

Moves the current Y position, relative to its current value. Positive values
will move the cursor up the page, negative values down. See ["y\_position"](#y_position).

## heading($text, %options)

Add a heading. If called on a new page, will automatically move the cursor down
to account for the heading's height (based on the assumption that one pixel
equals one point). Options available are:

- size _n_

    `n` is the font size in points, **default 16**

- indent _n_

    `n` is the amount (in points) to indent the text, **default 0**

- topmargin _n_

    `n` is the amount (in points) of vertical skip for the margin _above_ the
    heading, **default:** calculated automatically based on font size

- bottommargin _n_

    `n` is the amount (in points) of vertical skip for the margin _below_ the
    heading, **default:** calculated automatically based on the font size

## text($text, %options)

Add paragraph text. This will automatically paginate. Available options are
shown below. Any unrecogised options will be passed to `PDF::Builder`'s Column
method.

- format _name_

    `name` is the format of the text, in accordance with available formats in
    `PDF::Builder`. At the time of writing, supported options are `none`, `pre`,
    `md1` and `html`. If unspecified defaults to `none`.

- size _n_

    `n` is the font size in points, **default 10**

- indent _n_

    `n` is the amount (in points) to indent the paragraph first line, **default 0**

- top\_padding _n_

    `n` is the amount (in points) of padding above the paragraph, only applied if
    not at the top of a page. Defaults to half the line height.

- color _name_

    `name` is the string giving the text color, **default 'black'**

## table(%options)

Add a table, based on PDF::Table. Options available are `data` to pass in the
data for the table; all other options are passed to the table method of
PDF::Table.

## image($file, %options)

Add an image. Options available are:



( run in 0.944 second using v1.01-cache-2.11-cpan-39bf76dae61 )