This year again the WebKitGTK+ hackfest took place at the Igalia office in A Coruña, and this year again it’s been awesome.
My main goal for the hackfest was to implement an extension system for the web process in WebKit2, that would allow, among other things, to access the DOM, which is the major regression of the WebKit2 GTK+ API. The idea was to use the exactly same GObject DOM bindings API we are currently using in WebKit1, so I moved it to a convenient static library and installed the public headers in its own directory making it shareable between WebKit1 and WebKit2. Once GObject DOM bindings were accessible from WebKit2 I wrote a first patch to implement the web extension system providing a new API for extensions to access the DOM.
I also took advantage of the hackfest time, to re-take a task I had pending for some time, adding an API to WebKit2 to handle SSL errors. I didn’t have time to finish the API, but managed to write a first patch to set a policy for SSL errors. For now it only allows to ignore SSL errors and continue the load or make the load fail in case of SSL errors. The idea is to add a new policy to ask the user what to do.
Even though it was not part of my initial plans for the hackfest I ended up working on the document reading integration in Epiphany. I wrote an initial patch for Epiphany to load documents supported by Evince embedded in the window like a web view. There are still a lot of features to integrate like zooming, searching, printing, etc.
Epiphany showing a PDF document
I set a milestone to switch Epiphany to WebKit2 by default at the end of the hackfest, but I didn’t have time to fix all the regressions. We are a lot closer, though.
This event is impossible without the sponsors, thanks!
More than a month ago I released libgxps 0.1.0, the first release of libgxps, but for several reasons I ended up not announcing it. I’ve just released a new version that includes a small API break and a lot of new features and improvements, see the release notes for further details. I’ll release evince 3.3.2 next week depending on this new libgxps version (when building with –enable-xps).
Yes, it’s true, Cairo 1.10 has been finally released. Chris already summarized two years of development in 60 lines, so I’m going to talk about how this release affects to Evince/Poppler.
Cairo 1.10 has some new operators inspired by PDF blend modes, that allowed us to easily implement PDF blend modes in the poppler cairo backend
|PDF Blend Modes
Here is an example of a PDF document combining the use of Multiply blend mode with gradients
|Scooby gradient rendered by poppler with Cairo 1.8
|Scooby gradient rendered by poppler with Cairo 1.10
|Scooby gradient rendered by xpdf
Blend modes are also important for annotations, since highlight annotations are usually implemented by using the Multiply blend mode
There were some PDF documents where the performance of the poppler cairo backend was really bad. It seems that, with such particular documents, poppler was clipping too much. Of course, Chris fixed it, see the screenshot:
|Poppler with cairo 1.8 and 1.10
Output file size when printing
Thanks to cairo_surface_set_mime_data now we can attach the original uncompressed image to the ps/pdf surface that will be used when creating the resulting ps/pdf file. It drastically reduces the size of the ps/pdf output files created when printing documents that contain images
Fit to contents/Trim margins
This hasn’t been implemented in Evince yet, but using the new recording surface we can get the page bounding box and use it to implement a new fit to contents zoom mode.
Thank you very much to everybody involved in this release
I’d never heard about XPS format until someone filed a bug report asking to support it in Evince. It doesn’t seem to be commonly used, at least in the free software community, since there are just a few requests in bugzilla. However, I downloaded and read the XPS specification (thanks to Okular) just out of curiosity, and it sounded like something fun to implement. Taking advantage of the quiet summer days I started to write a library based on GLib/GObject and Cairo to render XPS documents.
Today, the library implements the minimum stuff to be able to read the XPS spec (rendering, outline and links) and I’ve added a new backend to Evince that uses it. There are still some known bugs and many things to do, but it’s possible to read quite a lot of XPS documents with Evince already.
|XPS Specification in Evince
I’ve finally added support for adding new annotations to Evince. At the moment only text annotations are supported and it requires poppler from current git master. There are still things to do, but the main functionality is working now. The idea is to add support for more annotation types (geometry, highlight, file attachments, …) during the next release cycle, since we are close to feature freeze. Click on the image to see a screencast showing how it currently works, you can add annotations from the side panel, change the default properties (author, color, transparency, icon, …), and save a copy that can be opened with any other document viewer that supports annotations like, of course, Acrobat Reader.
|(click to play back, ogg/theora, ~8,7M MBytes)
By the way
As announced in the release notes of GNOME 2.28, Evince has been ported to windows. Thanks to the great work done by Hib Eris we already have a windows installer available here.
And of course the mandatory screenshot:
|Evince running on Windows XP
I said in my previous post I was going to talk about Evince 2.26, but I haven’t managed to find time to do it. Anyway, I guess that at this time everybody has already discovered the new features of Evince 2.26, so I’ll talk about 2.27.1 now.
2.27.1 is the first unstable release leading up to Evince 2.28. It has been released a week later, because the annotations support wasn’t ready, and we wanted to include it in the first release of the development cycle. At the moment only Text Annotations (those represented by an icon in the document with a popup window associated) are supported, and only existing annotations can be modified. Poppler doesn’t support adding new annotations to the document yet, so this will be the next step. Once we have complete support of Text Annotations, adding support for other annotation types should be easier.
|A PDF document with text annotations in evince
I have to say that this has been done thanks to the great work done by Iñigo Martínez as part of the Google Summer Of Code program. I just continued his work.
Annotations are not the only new feature of this release, see the NEWS file for a complete list of changes. And we are still at the beginning of the cycle!
Annotations support is in our RoadMap since GNOME 2.20, and it has been the main goal since then. However, we failed in 2.22, in 2.24 and we are going to fail again in 2.26.
Lack of time is the main reason for this failure (remember that we, the Evince development team, are all volunteers), but it’s not the only one. During the 2.25/2.26 cycle we have started to work on the annotations stuff, although (as usual) a little bit late, when the feature freeze deadline approached. When we had the minimum support already implemented, we realized that poppler didn’t have support for writing annotations yet. I don’t know why, but I was quite sure it was already implemented. The thing is that there isn’t writing support for annotations in poppler right now. So we had, at least, two options: releasing evince 2.26 with annotations support in a read only mode or delaying the annotations support to the next cycle once again. Both have advantages and disadvantages, but the main reason why we decided not to release 2.26 with annots support is because we don’t think that annotations are useful if you can’t actually use them. I’m sure we were going to receive lots of bug reports about non editable popups.
So, what’s the plan? The idea is to implement writing support in poppler ASAP, and merge the evince code early in the next development cycle.
Despite the annots stuff, I’m very happy with the work done during this cycle, but I think I’ll better talk about Evince 2.26 later in another post.
This release is very special, since it includes an important architectural change, Gio/Gvfs a replacement for GNOME-VFS. Many people have worked hard to bring us a new GNOME stable release with important architectural changes, without regressions and in a six months release cycle. It’s awesome!. Not so much time ago, we didn’t have support for some basic network protocols such as ftp, the connect to server dialog in nautilus hadn’t been ported to Gio/Gvfs as well as many of our core modules, computer:// and network:// weren’t implemented either, etc. There are too many heroes in this release. Thanks to everybody. I love the GNOME community and I’m really happy to be part of it.
There are also many improvements in Evince for this new GNOME release:
- Most of the annoying popups dialogs have been replaced by a message area in the view. Based on the gedit message area.
- Transition effects in presentations are now supported (Thanks Carlos!)
- Thanks to the Google Highly Open Participation Contest automatic and kinetic scrolling have been implemented
- Many many improvements and bug fixes in the PS backend thanks to the use of libspectre.
- Important performance improvements of speed and memory consumption
- Many other bugs fixed
The new season starts this weekend. I’m looking forward to watching the first race
It’s not a surprise that libspectre was thought to be used mainly (but not only) by evince and okular. I’ve just committed a patch to evince to use libspectre when it’s present, otherwise falling back to gs. I haven’t removed the old gs code because libspectre is still too new and it’s not yet shipped by distros.
There are many many advantages of using libspectre in evince, some of them:
- One of the most important advantages is probably that it’s noticeable faster.
- Postscript printing improvements: print as PDF, multiple copies (bug #443859), reverse and collate are now supported.
- Page labels
- PS specials support in dvi documents (bug #386005)
- Other bugs fixed: #317106, #499787, #501235, #421879, #445797, #486547