Struct pdf_canvas::Canvas [] [src]

pub struct Canvas<'a> { /* fields omitted */ }

An visual area where content can be drawn (a page).

Provides methods for defining and stroking or filling paths, as well as placing text objects.

TODO Everything here that takes a BuiltinFont should take any FontSource instead.

Methods

impl<'a> Canvas<'a>
[src]

Append a closed rectangle with a corner at (x, y) and extending width × height to the to the current path.

Set the line join style in the graphics state.

Set the line join style in the graphics state.

Set the line width in the graphics state.

Set color for stroking operations.

Set color for non-stroking operations.

Modify the current transformation matrix for coordinates by concatenating the specified matrix.

Append a straight line from (x1, y1) to (x2, y2) to the current path.

Begin a new subpath at the point (x, y).

Add a straight line from the current point to (x, y) to the current path.

Add an Bézier curve from the current point to (x3, y3) with (x1, y1) and (x2, y2) as Bézier controll points.

Add a circle approximated by four cubic Bézier curves to the current path. Based on http://spencermortensen.com/articles/bezier-circle/

Stroke the current path.

Close and stroke the current path.

Fill the current path.

Get a FontRef for a specific font.

Create a text object.

The contents of the text object is defined by the function render_text, by applying methods to the TextObject it gets as an argument. On success, return the value returned by render_text.

Utility method for placing a string of text.

Utility method for placing a string of text.

Utility method for placing a string of text.

Add an item for this page in the document outline.

An outline item associates a name (contained in an ordered tree) with a location in the document. The PDF standard supports several ways to specify an exact location on a page, but this implementation currently only supports linking to a specific page (the page that this Canvas is for).

Save the current graphics state. The caller is responsible for restoring it later.

Restor the current graphics state. The caller is responsible for having saved it earlier.