ShapeRenderer
Overview
ShapeRenderer is a class in Aspose.Words FOSS for Python.
Renders shapes, images, and positioned elements.
Methods
| Signature | Description |
|---|---|
__init__(writer: LdmPdfWriter) | |
compress_image_bytes(image_bytes: bytes) → bytes | Apply image_compression and jpeg_quality options to raw image bytes. |
render_shape(pdf: FPDF, shape: ldm.ShapeNode) | Render a ShapeNode: image first (if any), then text-box paragraphs. |
render_image_shape(pdf: FPDF, shape: ldm.ShapeNode) | Embed an image from a ShapeNode into the PDF, scaling to fit page width. |
render_floating_images(pdf: FPDF, para: ldm.Paragraph) | Draw wrapNone images at their anchor coordinates. |
render_positioned_shapes(pdf: FPDF, doc: ldm.Document) | Draw every absolutely-positioned shape on the current (first) page. |
render_positioned_shapes_in(pdf: FPDF, paragraphs: list[ldm.Paragraph], line_y_override: Optional[float]) | Draw positioned shapes carried by paragraphs without moving cursor. |
render_positioned_shape(pdf: FPDF, shape: ldm.ShapeNode, line_y_override: Optional[float]) | Draw a positioned shape at its absolute page coordinates. |
estimate_text_box_height(paragraphs: list[ldm.Paragraph]) → float | Approximate the laid-out height of a list of paragraphs in mm. |