Fit 类

class pypdf.generic.Fit(fit_type: str, fit_args: Tuple[None | float | Any, ...] = ())[源代码]

基类:object

classmethod xyz(left: float | None = None, top: float | None = None, zoom: float | None = None) Fit[源代码]

Display the page designated by page, with the coordinates (left, top) positioned at the upper-left corner of the window and the contents of the page magnified by the factor zoom.

A null value for any of the parameters left, top, or zoom specifies that the current value of that parameter is to be retained unchanged.

A zoom value of 0 has the same meaning as a null value.

参数:
  • left

  • top

  • zoom

返回:

The created fit object.

classmethod fit() Fit[源代码]

Display the page designated by page, with its contents magnified just enough to fit the entire page within the window both horizontally and vertically.

If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the page within the window in the other dimension.

classmethod fit_horizontally(top: float | None = None) Fit[源代码]

Display the page designated by page, with the vertical coordinate top positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of the page within the window.

A null value for top specifies that the current value of that parameter is to be retained unchanged.

参数:

top

返回:

The created fit object.

classmethod fit_vertically(left: float | None = None) Fit[源代码]
classmethod fit_rectangle(left: float | None = None, bottom: float | None = None, right: float | None = None, top: float | None = None) Fit[源代码]

Display the page designated by page, with its contents magnified just enough to fit the rectangle specified by the coordinates left, bottom, right, and top entirely within the window both horizontally and vertically.

If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the rectangle within the window in the other dimension.

A null value for any of the parameters may result in unpredictable behavior.

参数:
  • left

  • bottom

  • right

  • top

返回:

The created fit object.

classmethod fit_box() Fit[源代码]

Display the page designated by page, with its contents magnified just enough to fit its bounding box entirely within the window both horizontally and vertically.

If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the bounding box within the window in the other dimension.

classmethod fit_box_horizontally(top: float | None = None) Fit[源代码]

Display the page designated by page, with the vertical coordinate top positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of its bounding box within the window.

A null value for top specifies that the current value of that parameter is to be retained unchanged.

参数:

top

返回:

The created fit object.

classmethod fit_box_vertically(left: float | None = None) Fit[源代码]

Display the page designated by page, with the horizontal coordinate left positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of its bounding box within the window.

A null value for left specifies that the current value of that parameter is to be retained unchanged.

参数:

left

返回:

The created fit object.