Pitfalls 12 entries
errors that fail without raising
Entries in this section
- Wrong font name fails silentlyNo exception, no font change, no warning. You have to read it back to find out it failed.
- Text.FontProperties swallows the font sizeSetting Size through it does nothing. In batch code you have to go through Story.Character
- Collection indexes start at 1Pages.Item(1) is the first page. In Python that means range(1, n+1).
- Objects inside containers have no Left/TopReading Left/Top on a shape inside a PowerClip raises. GetBoundingBox() is the only way in
- ConvertToCurves is irreversibleAfter ConvertToCurves every text property is gone, and a wrong font is baked in permanentl
- Stale object reference after ConvertToCurvesAfter converting or deleting, re-fetch doc.Pages.Item(i) and ActiveLayer, or the next Crea
- Do not read a shape after DeleteAfter Delete, even reading StaticID raises. Wrap traversal bodies in try/except.
- HexValue casing is inconsistentNormalize with .upper() before comparing, or your color filter quietly misses things.
- len(doc.Pages) may not workUse doc.Pages.Count instead of len(doc.Pages).
- No sleep: CorelDRAW appears to hangRapid-fire calls trigger COM busy errors. 0.2 s for property work, 0.5 s for image imports
- Unclosed undo group freezes CorelDRAWIf an exception escapes after BeginCommandGroup, CDR stays stuck inside the group. Put End
- Saving inside a loop is extremely slowExport and save are heavy operations. Run the loop, then save once at the end.
Getting StartedConnection & InitApplicationDocumentPageLayer & ShapesGeometry & TransformGroup / Order / BooleanShape AppearanceTextTextRangeFillOutlinePowerClipFountain FillPattern / Texture FillTransparency & BlendEffectsColorCurve & NodeBitmapFind & TraverseUnits & ConversionImport / ExportEnumerationsObject DataAlign / DistributeLayer AdvancedView & PerformanceEventsRecipesPitfalls