pub trait Transformable {
Show 13 methods fn transform(
        &mut self,
        a: PdfMatrixValue,
        b: PdfMatrixValue,
        c: PdfMatrixValue,
        d: PdfMatrixValue,
        e: PdfMatrixValue,
        f: PdfMatrixValue
    ) -> Result<(), PdfiumError>; fn set_matrix(&mut self, matrix: PdfMatrix) -> Result<(), PdfiumError> { ... } fn translate(
        &mut self,
        delta_x: PdfPoints,
        delta_y: PdfPoints
    ) -> Result<(), PdfiumError> { ... } fn scale(
        &mut self,
        horizontal_scale_factor: PdfMatrixValue,
        vertical_scale_factor: PdfMatrixValue
    ) -> Result<(), PdfiumError> { ... } fn flip_horizontally(&mut self) -> Result<(), PdfiumError> { ... } fn flip_vertically(&mut self) -> Result<(), PdfiumError> { ... } fn reflect(&mut self) -> Result<(), PdfiumError> { ... } fn rotate_counter_clockwise_degrees(
        &mut self,
        degrees: PdfMatrixValue
    ) -> Result<(), PdfiumError> { ... } fn rotate_clockwise_degrees(
        &mut self,
        degrees: PdfMatrixValue
    ) -> Result<(), PdfiumError> { ... } fn rotate_counter_clockwise_radians(
        &mut self,
        radians: PdfMatrixValue
    ) -> Result<(), PdfiumError> { ... } fn rotate_clockwise_radians(
        &mut self,
        radians: PdfMatrixValue
    ) -> Result<(), PdfiumError> { ... } fn skew_degrees(
        &mut self,
        x_axis_skew: PdfMatrixValue,
        y_axis_skew: PdfMatrixValue
    ) -> Result<(), PdfiumError> { ... } fn skew_radians(
        &mut self,
        x_axis_skew: PdfMatrixValue,
        y_axis_skew: PdfMatrixValue
    ) -> Result<(), PdfiumError> { ... }
}
Expand description

Common transformation setter operations that can be applied to a variety of PDF objects, including pages, individual page objects, and groups of page objects.

Required Methods§

source

fn transform(
    &mut self,
    a: PdfMatrixValue,
    b: PdfMatrixValue,
    c: PdfMatrixValue,
    d: PdfMatrixValue,
    e: PdfMatrixValue,
    f: PdfMatrixValue
) -> Result<(), PdfiumError>

Applies the given transformation, expressed as six values representing the six configurable elements of a nine-element 3x3 PDF transformation matrix, to this page or page object.

To move, scale, rotate, or skew this object, consider using one or more of the following functions. Internally they all use Transformable::transform(), but are probably easier to use (and certainly clearer in their intent) in most situations.

The order in which transformations are applied is significant. For example, the result of rotating then translating an object may be vastly different from translating then rotating the same object.

An overview of PDF transformation matrices can be found in the PDF Reference Manual version 1.7 on page 204; a detailed description can be founded in section 4.2.3 on page 207.

Provided Methods§

source

fn set_matrix(&mut self, matrix: PdfMatrix) -> Result<(), PdfiumError>

Applies the values in the given PdfMatrix to this transformable object.

source

fn translate(
    &mut self,
    delta_x: PdfPoints,
    delta_y: PdfPoints
) -> Result<(), PdfiumError>

Moves the origin of this object by the given horizontal and vertical delta distances.

source

fn scale(
    &mut self,
    horizontal_scale_factor: PdfMatrixValue,
    vertical_scale_factor: PdfMatrixValue
) -> Result<(), PdfiumError>

Changes the size of this object, scaling it by the given horizontal and vertical scale factors.

source

fn flip_horizontally(&mut self) -> Result<(), PdfiumError>

Flips this object horizontally around its origin by applying a horizontal scale factor of -1.

source

fn flip_vertically(&mut self) -> Result<(), PdfiumError>

Flips this object vertically around its origin by applying a vertical scale factor of -1.

source

fn reflect(&mut self) -> Result<(), PdfiumError>

Reflects this object by flipping it both horizontally and vertically around its origin.

source

fn rotate_counter_clockwise_degrees(
    &mut self,
    degrees: PdfMatrixValue
) -> Result<(), PdfiumError>

Rotates this object counter-clockwise by the given number of degrees.

source

fn rotate_clockwise_degrees(
    &mut self,
    degrees: PdfMatrixValue
) -> Result<(), PdfiumError>

Rotates this object clockwise by the given number of degrees.

source

fn rotate_counter_clockwise_radians(
    &mut self,
    radians: PdfMatrixValue
) -> Result<(), PdfiumError>

Rotates this object counter-clockwise by the given number of radians.

source

fn rotate_clockwise_radians(
    &mut self,
    radians: PdfMatrixValue
) -> Result<(), PdfiumError>

Rotates this object clockwise by the given number of radians.

source

fn skew_degrees(
    &mut self,
    x_axis_skew: PdfMatrixValue,
    y_axis_skew: PdfMatrixValue
) -> Result<(), PdfiumError>

Skews the axes of this object by the given angles in degrees.

source

fn skew_radians(
    &mut self,
    x_axis_skew: PdfMatrixValue,
    y_axis_skew: PdfMatrixValue
) -> Result<(), PdfiumError>

Skews the axes of this object by the given angles in radians.

Implementors§