Home/ Reference/ Import / Export

layer.Import(path, 0, None)

Imports an image or SVG. 0 means auto-detect the format. The object ends up selected, so grab it with app.ActiveSelectionRange(1) immediately.

Signature

layer.Import(path, 0, None)

Notes

Imports an image or SVG. 0 means auto-detect the format. The object ends up selected, so grab it with app.ActiveSelectionRange(1) immediately.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
layer = doc.ActivePage.ActiveLayer

# Import(path, filter, options): 0 = detect, None = defaults
layer.Import("D:/images/logo.svg", 0, None)

obj = app.ActiveSelectionRange(1)       # it arrives selected, so grab it now
print("Imported, size: ", obj.SizeWidth, "x", obj.SizeHeight)

About this section: Import / Export

Import / Export — import, export, save and print.

Other entries in this section