This is what I'm doing:
const opt = host.CreateStructExportOptions();opt.AntiAliasingType = host.cdrNormalAntiAliasing;opt.ImageType = host.cdrRGBColorImage;opt.Overwrite = true;const exportFileName = "C:\\test.png";host.ActiveDocument.Export(exportFileName, host.cdrPNG, host.cdrSelection, opt, undefined);
1) maybe you just didn't select shape for export
2) maybe also need to specify the resolution and image dimensions
Tried to do both, didn't work. Here's what I have now.
const opt = host.CreateStructExportOptions();opt.AntiAliasingType = host.cdrNormalAntiAliasing;opt.ImageType = host.cdrRGBColorImage;opt.Overwrite = true;opt.ResolutionX = 72;opt.ResolutionY = 72;opt.SizeX = opt.ResolutionX * 300;opt.SizeY = opt.ResolutionY * 300;const exportFileName = "C:\\test.jpg";let exporting = host.ActiveDocument.Export(exportFileName, host.cdrJPEG, host.cdrSelection, opt, undefined);
you finish export task? ExportFilter.Finish method - Developer Area - CorelDRAW Community
make sure the layer the shape is on is printable.
check the file name, maybe it would be more correct: "C:\test.jpg"?
Tried it. I get the error 'Can not read property 'Finish' of undefined'