Skip to main content
Version: API v2 Preview

ImageTransformRequest

Kind: class
Module/package: models
SDK: pdfdancer-client-python 2.0.0

Request to transform an image in the PDF document.

Parameters:

  • object_ref: Reference to the image to transform.
  • transform_type: Type of transformation (REPLACE, SCALE, ROTATE, CROP, OPACITY, FLIP).
  • new_image: For REPLACE - the replacement Image object.
  • scale_factor: For SCALE - scaling factor (e.g., 0.5 for half size).
  • target_size: For SCALE - target Size with width/height.
  • preserve_aspect_ratio: For SCALE - maintain proportions.
  • rotation_angle: For ROTATE - angle in degrees.
  • crop_left/crop_top/crop_right/crop_bottom: For CROP - pixels to crop from edges.
  • opacity: For OPACITY - value 0.0-1.0.
  • flip_direction: For FLIP - HORIZONTAL, VERTICAL, or BOTH.

Declaration

ImageTransformRequest(object_ref: pdfdancer.models.ObjectRef, transform_type: pdfdancer.models.ImageTransformType, new_image: pdfdancer.models.Image | None = None, scale_factor: float | None = None, target_size: pdfdancer.models.Size | None = None, preserve_aspect_ratio: bool | None = None, rotation_angle: float | None = None, crop_left: int | None = None, crop_top: int | None = None, crop_right: int | None = None, crop_bottom: int | None = None, opacity: float | None = None, flip_direction: pdfdancer.models.ImageFlipDirection | None = None, fill_region_x: int | None = None, fill_region_y: int | None = None, fill_region_width: int | None = None, fill_region_height: int | None = None, fill_color: int | None = None) -> None

Members

__init__

__init__(self, object_ref: pdfdancer.models.ObjectRef, transform_type: pdfdancer.models.ImageTransformType, new_image: pdfdancer.models.Image | None = None, scale_factor: float | None = None, target_size: pdfdancer.models.Size | None = None, preserve_aspect_ratio: bool | None = None, rotation_angle: float | None = None, crop_left: int | None = None, crop_top: int | None = None, crop_right: int | None = None, crop_bottom: int | None = None, opacity: float | None = None, flip_direction: pdfdancer.models.ImageFlipDirection | None = None, fill_region_x: int | None = None, fill_region_y: int | None = None, fill_region_width: int | None = None, fill_region_height: int | None = None, fill_color: int | None = None) -> None

Initialize self. See help(type(self)) for accurate signature.

to_dict

to_dict(self) -> Dict[str, Any]

Convert to dictionary for JSON serialization.

View source at af2a1171a1b9