The CDR format is the basic format of CorelDraw software, but they do not disclose the file structure. If you want to parse it, you need to crack it by yourself.
Currently, there are two methods. The first method is to directly guess byte values. Currently, there are several Python-based resolutions.Program, Unicovert, inkscape, and so on are all completed by calling the sk1 package, which is difficult to learn and not fully supported,
Another method is to simulate the parsing of CorelDraw's VBA script. Using C # Or C ++, you can call the COM component for parsing. Notes:
- Basic Structure CDR file-> page-> layer-> graphics. From top to bottom, all subscripts start from 1.
- When calling each interface, note that the variable type must be strictly consistent. For example, if the parameter of item [] is long, int must not be input; otherwise, an error occurs.
You also need to master several basic concepts:
- Home page: the home page can be displayed on each page.
- Main layer.
To be continued...
References:
Http://forum.oberonplace.com/forumdisplay.php? F = 16
Basics of VC developmentCode, For reference only.
# include "stdafx. H "# import" vgcoreauto. TLB "RENAME (" getcommandline "," vggetcommandline "), rename (" copyfile "," vgcopyfile "), rename (" findwindow "," vgfindwindow ") no_namespace named_guids # import "CorelDraw. TLB "RENAME (" findwindow "," cdrfindwindow ") named_guidsint _ tmain (INT argc, _ tchar * argv []) {coinitialize (null); CorelDraw :: idrawapplicationptr Papp (L "CorelDraw. application.14 "); CorelDraw: idrawpageptr ptargetpage = PAPP-> activepage; ptargetpage-> activelayer-> createrectangle ); try {ptargetpage-> createlayer ("testlayer");} catch (_ com_error) {} couninitialize (); Return 0 ;}