[Ipe-discuss] Save as SVG

Otfried Cheong otfried at ipe.airpost.net
Fri Mar 1 16:12:21 CET 2019


I could relatively easily add "Export as SVG" to the Ipe file menu, if that is helpful.

I don't think I can maintain another official Ipe document format:

1. I don't really know how good the SVG output is.  Iperender simply draws one Ipe page to a canvas using Cairo, and lets Cairo produce the output - so Ipe has no control over what precisely is written.

To use SVG as an official Ipe output format, we would have to be quite confident that the SVG output is really of the same quality as the PDF output.

2. I'm not sure if Cairo supports multi-page SVG files, so one would have to hack around this by writing each page individually and combining them somehow.

3. Cairo writes a self-contained SVG-file, so to insert the Ipe XML-stream, Ipe would have to reopen that file and insert the data at some suitable location.

It's all doable, but sounds like a lot of work for rather limited benefit.    For instance,  you could automate the process with a script or a Makefile instead.   

remarkjs looks interesting, please share your experiences with it.

Cheers,
  Otfried



On Fri, Mar 1, 2019, at 14:09, Tim Hutt via Ipe-discuss wrote:
> Hi,
> 
> How hard would it be to add support for saving files as SVG? Iperender
> apparently supports exporting to SVG, so I assume the SVG-writing code
> is already done. And you could pretty easily embed the IPE file data
> in the SVG in a <metadata> element, e.g.
> 
>   <svg ... xmlns:ipe="...">
>     <metadata>
>       <ipe:data> ...ipe data... </ipe:data>
>     </metadata>
>     ...
> 
> My use case is making an HTML5 presentation (with remarkjs). It would
> be really nice if I could just include IPE diagrams via <img
> src="mydiagram.svg"> but as it stands I would have to save them as
> .ipe and then run iperender which is a slightly annoying extra step.
> 
> Cheers,
> 
> Tim
> _______________________________________________
> Ipe-discuss mailing list
> Ipe-discuss at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/ipe-discuss
>


More information about the Ipe-discuss mailing list