Save notes in SVG format

Asked by Kovid Goyal

Hi,

I'd like to request that Quill use SVG to save notes. This will make .quill files accessible in other programs and for all time. It will also then be easy to import Xournal .xoj files into Quill.

Question information

Language:
English Edit question
Status:
Answered
For:
Quill Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Antonio Salazar (shadowfiend) said :
#2

Just noticed this; apologies.

Revision history for this message
Antonio Salazar (shadowfiend) said :
#3

At a glance, it seems like this would be significantly less efficient, as SVG would require one element per line of different width, of which there can be many in a stroke due to the various pressures. The point of Quill isn't so much to generate high-quality vector graphics; the drawings just happen to be stored in vector form. I intend on making something that will export to Xournal's file format and import from it, as well (the structure of the serializers and dezerializers should allow that in a relatively straightforward fashion), but it doesn't seem like Xournal's file format is SVG-based, either.

Do note that exporting to SVG would probably be both doable and probably nearly as easy as exporting to PDF, considering the support for SVG in Qt. I have not looked at this yet.

Revision history for this message
Antonio Salazar (shadowfiend) said :
#4

In fact, some quick investigation later, it's evident that combining a QPainter opened on an instance of QSvgGenerator with QGraphicsScene::render (which is basically the way that printing is done, but piecewise for each page) would give us exactly the desired effect of rendering a Quill file into an SVG file.

Revision history for this message
Kovid Goyal (kovid) said :
#5

I agree that there is no need to make the file format SVG based, but implementing SVG import and export would be very useful for the following use cases:

1) Import an existing SVG figure and modify it easily with hand drawn strokes. This is particularly nice when you have some base diagram which you just want to add some annotations to
2) Export to SVG and further process the exported file with say inkscape, which has nice graphics tools to draw geometrical shapes/textures etc.

I'm not sure how easy import will be, but export should be trivial, as you've noted.

Revision history for this message
Antonio Salazar (shadowfiend) said :
#6

Import would be significantly more difficult, because we would have to convert the SVG types to internal Quill object types, and there will be a mismatch there. However, in terms of adding annotations to a diagram, it should be trivial to allow setting an SVG as a background (like the background concept in Xournal) using Qt's SVG rendering facilities. We'd only support the stuff Qt supports in terms of SVG, but I think that's okay.

My key concern with Quill at the moment, sadly, is out of my control, and it is that Qt is reporting far fewer tablet events than it should be. Any quick stroke drawing, by consequence, produces stark corners. It looks like someone has already noticed this on qt-interest, but nothing's been done about it. At some point I need to sit down and see what the difference is between Qt3 and Qt4's handing of tablet events (it turns out that Qt3 did not have this problem) to try and fix the issue. Nonetheless, in the meantime I might try to set up a generic import/export framework. I need to decide whether I want to differentiate between `import' and `open' and between `export' and `save'.

I also need to add background image stuff. But I want to investigate using poppler to paint PDFs natively, as well, for that.

Revision history for this message
Kovid Goyal (kovid) said :
#7

Hmm I don't really like the background concept in Xournal. It's great for annotating PDFs, but not so great for creating a complex dicuments that includes embedded images. Sometimes it's necessary to import a graphic as an object. In fact I'll take this opportunity to request that feature. It should be easy to just create a QGraphicsItem and add it to the view when the user wants to import a graphic into the current document.

Revision history for this message
Antonio Salazar (shadowfiend) said :
#8

Indeed, importing images is easy. Integrating it into the UI less so. My current focus is figuring out a good way to have access to useful features near the stylus when it lifts up without getting in the way of writing and drawing. I don't want to clutter up toolbars or menus when they're already so far out of the way when you're in the middle of writing on the page. Regardless, please request that separately so that I have separate things to look at :)

Revision history for this message
Kovid Goyal (kovid) said :
#9

Would you prefer to have bug reports or questions?

Revision history for this message
Antonio Salazar (shadowfiend) said :
#10

In the end, I will manage them as bug reports, but feel free to file them as either; I will create associated bug reports if needed.

Can you help with this problem?

Provide an answer of your own, or ask Kovid Goyal for more information if necessary.

To post a message you must log in.