shape.AddToPowerClip(clipShape, centerInParent)
Puts the current shape inside the clipShape container. The second argument, True, centers it automatically. In the code: img.AddToPowerClip(pdf_rect, True).
Signature
shape.AddToPowerClip(clipShape, centerInParent)
Notes
Puts the current shape inside the
clipShape container. The second argument, True, centers it automatically. In the code: img.AddToPowerClip(pdf_rect, True).Python example (runnable)
Requires
pywin32. The example assumes app / doc / page / layer are already connected.
See Connection & InitPython
page = doc.ActivePage
layer = page.ActiveLayer
# 1) draw a rectangle to act as the container
box = layer.CreateRectangle2(0, 0, 100/25.4, 80/25.4)
# 2) import an image (it arrives selected)
layer.Import("D:/images/photo1.jpg", 0, None)
img = app.ActiveSelectionRange(1)
# 3) place it inside; second argument True = centre it
img.AddToPowerClip(box, True)
print("Image placed into the frame")
About this section: PowerClip
PowerClip — clipping content into a frame.
- This section has 5 entries; this is one of them.
- See the full section index: PowerClip
Other entries in this section
- shape.PowerClipThe container object. A read-only door — you can inspect the contents
- shape.PowerClip.ShapesShapes inside the container. From here FindShapes can reach text — tha
- shape.PowerClip.Content?The generic entry point for container contents. Naming varies between
- shape.PowerClip.Extract?Pulls the contents out, the API equivalent of Extract Contents. Behavi