This week I have converted the entire CorelDraw Clipart collection to CMX format. These were about 28700 files!
CMX can be read by Sketch. Sketch can write in SVG. SVG is needed for Inkscape.
Corel Graphics suite 12 is supposed to write in SVG. I downloaded the trial version of Corel 12. Corel 12 cannot read its own CDR clipart and convert it to SVG!. Every file which I attempted to write in SVG produced errors, and the SVG file could not be opened by Sketch or Inkscape. So I decided to write a script in Corel 7 to convert from CDR to CMX
Writing a script for CorelDraw 7 to perform this was not that difficult, but Corel shows a good Windoze policy by not freeing up used memory when a file is closed. After conversion of 200-300 files, Corel would have used over 1 GB of memory.
So I wrote a script which can be called in batch mode and converts a small number of files (50). I called this script from a loop in a DOS batch file. The script holds track of which files still have to be converted, and every time it is called, it starts converting at the point where it had ended last time.
DOS batch file
To make the script as easy as possible, you need a file containing the names and paths of all files to be converted. An example file
It is important that all directories where the CMX files are written, already exit. Either you use the existing Clipart directory structure, or you do a ll -R, grep the directories and awk the mkdir command in front of all paths. I am sure you can put this on one command line, but you can also use a command file
like this one. It contains the correct file tree for the clipart collection which came with Corel 7
If you want to use the script, look thouroughly through it to see if it is suitable for your needs and directory structure. There is plenty of comment contained in the scripts.
On my AMD 1800+ it took about 28 hours to finish the conversion, so you have time to grab a cup of coffee while the conversion is in progress.
Now for the shameless question:
I have the collection in CMX format, but I would like to have it in SVG format. Sketch can do this conversion. Error free. I now need just a Python script which does the same as my Corel script did. Looking at the Python code of Sketch, I don't think this is complicated, if you know which objects to create (?) and call (?)
I am not interested in learning Python at this moment, and I don't want to put the effort in when it is just for one project. Is there someone who wants to help me, and write the basic script? No directory parsing is needed, I can provide a list with all files to be converted. I don care whether it is all in Python, or a combination of bash and Python. I can take care of the bash part myself. Something like calling:
convert.py oldfile newfile
would be ideal
I know it is shameless to ask someone else to wrote something for me, but I hope I contributed my share with writing the CDR->CMX conversion.