Hi.
I'm trying to export to PNG with JavaScript in Corel Draw 2020 but the image is not exporting. I do not get an error either. Can anyone let me know what I'm doing wrong?
Thank you.
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);