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 FOSS for Python 패키지를 설치한 후 모든 Python 애플리케이션에서 접근할 수 있습니다. 속성: annotations, content, crop_box, index, media_box, rect, 그리고 1개 더.
속성
| 이름 | 유형 | 액세스 | 설명 |
|---|---|---|---|
index | int | 읽기/쓰기 | 페이지의 0 기반 인덱스. |
rect | tuple[float, float, float, float] | 읽기 | 페이지 사각형을 가져옵니다 (MediaBox). |
annotations | AnnotationCollection | 읽기 | 페이지의 주석 컬렉션을 가져옵니다. |
media_box | tuple[float, float, float, float] | 읽기 | rect의 별칭입니다. |
rotation | int | 읽기/쓰기 | 페이지 회전 각도(시계 방향)이며, 0, 90, 180, 270 중 하나입니다. |
crop_box | tuple[float, float, float, float] | 읽기/쓰기 | 페이지 CropBox (x0, y0, x1, y1); 설정되지 않은 경우 MediaBox를 기본값으로 사용합니다. |
content | bytes | 읽기 | 페이지 콘텐츠 스트림을 가져옵니다. |
메서드
| 시그니처 | 설명 |
|---|---|
__init__(document: Document, index: int) | Calls init이 Page 인스턴스에서 (document, index). |
| `add_text(text: str, x: float, y: float, font_size: float, font_name: str | None, font: FontDescriptor |
| `add_image(image: bytes | bytearray |
| `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: str | None, alt: str |
accept(visitor: Any) | 이 페이지를 visit(page)을(를) 구현하는 객체에 전달합니다. |
| `render(dpi: float, scale: float, background: tuple[int, int, int], antialias: bool | int)→RasterizedPage` |
| `save_as_image(path: str | Path, 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 | 이 페이지의 단순 텍스트 표시 피연산자에서 기존 텍스트를 제거합니다. |