app.OpenDocument(path)
Opens an existing file. For batch edits, walk them with app.Documents.Item(i).
Signature
app.OpenDocument(path)
Notes
Opens an existing file. For batch edits, walk them with
app.Documents.Item(i).Python example (runnable)
Requires
pywin32. The example assumes app / doc / page / layer are already connected.
See Connection & InitPython
path = "D:/artwork/template.cdr"
doc = app.OpenDocument(path) # open it and return the Document
print("Opened: ", doc.FileName)
print("Pages: ", doc.Pages.Count)
# once open you drive it like any new document
About this section: Import / Export
Import / Export — import, export, save and print.
- This section has 9 entries; this is one of them.
- See the full section index: Import / Export
Other entries in this section
- layer.Import(path, 0, None)Imports an image or SVG. 0 means auto-detect the format. The object en
- doc.ExportEx(path, filter, options)General export. filter takes a cdrFilter value; pass None to use the d
- doc.PublishToPDF(path)PDF export. Fewest arguments, most reliable — the first choice for pri
- doc.ExportBitmap(...)Bitmap export with a ten-argument signature (width, height, dpi, antia
- doc.Save()Saves to the existing path.
- doc.SaveAs(path)Saves under a new path and points the document at it.
- doc.PrintOut()Prints. Takes a PrintOptions object.
- doc.Close()Closes the document. Unsaved changes raise a dialog that blocks the sc