Initial work on a Karbon CDR import filter

Boudewijn Rempt boud at valdyas.org
Sat Jan 28 10:04:54 GMT 2012


On Saturday 28 January 2012 Jan, Friedrich W. H. Kossebau wrote:
> Hi,
> 
> last weekend I started to try if I can do an import filter for the CorelDraw 
> file format. I managed to get first parts of that format decoded and turned 
> into some Karbon document data, see also my blog entry
> 	http://frinring.wordpress.com/2012/01/28/trying-to-read-files-from-the-
> past/
> 

Very exciting! Also because of the riff library!

> Some questions:
> Initially I tried to create directly a KarbonDocument object, not another SVG 
> file. But then I found out that shapes like e.g. Rectangle and Ellipsis are 
> only provided by factories from plugins, so I cannot create them directly from 
> code, is that correct? Do I really have to instead create a SVG file as 
> output? 

In general, it's really better to generate SVG and save that. It's possible to directly create shapes by getting the right factory from the registry and so on, but that's complicated and fragile; leave that job to Karbon itself. Most filters generate files in the application's native format.

The exceptions are Krita and the excel import filter for Tables; krita because raster image files are often huge and having an intermediate step would lead to performance problems (and also for historical reasons, it's always been this way). The excel filter directly fills a Tables document mostly for the same reason.

> Anybody would like to join the efforts? You are welcome! The CDR formats I 
> will work on are the ones for version 4 and 5 (as these are the ones of the 
> files I am interested in). So people with other versions will have to scratch 
> their itch themselves :)
> 
> You can find the current state in the branch “CDRImport” in my clone of the 
> Calligra repo here:
> http://quickgit.kde.org/?p=clones%2Fcalligra%2Fkossebau%2Fcalligra.git&a=summary

Feel free to create a branch in the main Calligra git repo and work in there -- that way everyone will see what's happening :-).


-- 
Boudewijn Rempt
http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl



More information about the calligra-devel mailing list