pub enum PdfPagePaperSize {
    Portrait(PdfPagePaperStandardSize),
    Landscape(PdfPagePaperStandardSize),
    Custom(PdfPointsPdfPoints),
}
Expand description

The paper size of a PdfPage.

Variants

Portrait(PdfPagePaperStandardSize)

A known paper size in portrait orientation.

Landscape(PdfPagePaperStandardSize)

A known paper size in landscape orientation.

Custom(PdfPointsPdfPoints)

A custom paper size, expressed as a (width, height) tuple in PdfPoints.

Implementations

Returns the PdfPagePaperSize matching the given dimensions, or PdfPagePaperSize::Custom if no match can be made.

Returns the PdfPagePaperSize matching the given dimensions, or PdfPagePaperSize::Custom if no match can be made.

Returns the PdfPagePaperSize matching the given dimensions, or PdfPagePaperSize::Custom if no match can be made.

Returns the PdfPagePaperSize matching the given dimensions, or PdfPagePaperSize::Custom if no match can be made.

Creates a new portrait PdfPagePaperSize from a standard PdfPagePaperStandardSize.

Creates a new landscape PdfPagePaperSize from a standard PdfPagePaperStandardSize.

Creates a new custom PdfPagePaperSize from the given dimensions.

Creates a new portrait A4 PdfPagePaperSize.

Creates a new portrait A4R PdfPagePaperSize, equivalent to landscape A4. In terms of paper size, this is equivalent to calling [PdfPagePaperSize::a4().to_landscape()]

Creates a new portrait A3 PdfPagePaperSize.

Rotates a landscape PdfPagePaperSize into a portrait PdfPagePaperSize and vice versa, consuming this PdfPagePaperSize.

Custom sizes have their height and width dimensions swapped.

Rotates a portrait PdfPagePaperSize into a landscape PdfPagePaperSize if necessary. A new PdfPagePaperSize value is returned; this PdfPagePaperSize is not affected. Sizes already in landscape are not changed. Custom sizes are changed only if the current height is greater than the width, in which case the dimensions are swapped.

Rotates a landscape PdfPagePaperSize into a portrait PdfPagePaperSize if necessary. A new PdfPagePaperSize value is returned; this PdfPagePaperSize is not affected. Sizes already in portrait are not changed. Custom sizes are changed only if the current width is greater than the height, in which case the dimensions are swapped.

Returns the width of this PdfPagePaperSize.

Returns the height of this PdfPagePaperSize.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.