Page

概要

Page は Aspose.PDF の FOSS における Python 用のクラスです。

PDF ドキュメントのページ。

このクラスは、Python プログラムで Page オブジェクトを操作するための10個のメソッドを提供します。利用可能なメソッドは、__init__、accept、add_image、add_text、draw_line、draw_rectangle、redact_text、render、replace_text、save_as_image です。すべてのパブリックメンバーは、Aspose.PDF の Python 用 FOSS パッケージをインストールした後、任意の Python アプリケーションからアクセス可能です。プロパティ: annotations、content、crop_box、index、media_box、rect、および 1 つが追加されます。

プロパティ

名前型アクセス説明
indexint読み取り/書き込みページのゼロベースインデックス。
recttuple[float, float, float, float]読み取りページの矩形を取得します (MediaBox).
annotationsAnnotationCollection読み取りページ上のアノテーションのコレクションを取得します。
media_boxtuple[float, float, float, float]読み取りrect のエイリアスです。
rotationint読み取り/書き込みページの回転角度(時計回り)を度数で表したものです(0、90、180、270 のいずれか)。
crop_boxtuple[float, float, float, float]読み取り/書き込みページ CropBox (x0, y0, x1, y1);未設定時は MediaBox にフォールバックします。
contentbytes読み取りページのコンテンツストリームを取得します。

メソッド

シグネチャ説明
__init__(document: Document, index: int)Calls init(document, index) がこの Page インスタンス上にあります。
`add_text(text: str, x: float, y: float, font_size: float, font_name: strNone, font: FontDescriptor
`add_image(image: bytesbytearray
`draw_rectangle(x: float, y: float, width: float, height: float, stroke_color: Sequence[float]None, fill_color: Sequence[float]
`draw_line(x1: float, y1: float, x2: float, y2: float, stroke_color: Sequence[float], line_width: float, tag: strNone, alt: str
accept(visitor: Any)このページを visit(page) を実装したオブジェクトにディスパッチします。
`render(dpi: float, scale: float, background: tuple[int, int, int], antialias: boolint)→RasterizedPage`
`save_as_image(path: strPath, dpi: float, scale: float, background: tuple[int, int, int], antialias: bool
replace_text(search: str, replacement: str, case_sensitive: bool, max_count: int) → intこのページの単純テキスト表示オペランドの既存テキストを置き換えてください。
redact_text(search: str, case_sensitive: bool, max_count: int, overlay: bool, overlay_color: Sequence[float]) → intこのページの単純テキスト表示オペランドから既存テキストを削除してください。

参照

 日本語