Cairo 1.10

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.

Blend Modes

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
PDF Blend Modes

Here is an example of a PDF document combining the use of Multiply blend mode with gradients

Scooby gradient rendered with Cairo 1.8
Scooby gradient rendered by poppler with Cairo 1.8
Scooby gradient rendered by poppler with Cairo 1.10
Scooby gradient rendered by poppler with Cairo 1.10
Scooby gradient rendered by xpdf
Scooby gradient rendered by xpdf

Blend modes are also important for annotations, since highlight annotations are usually implemented by using the Multiply blend mode

Performance

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
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.

Thanks!

Thank you very much to everybody involved in this release

XPS Documents

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
XPS Specification in Evince

Adding new annotations with 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.

Evince annotations
(click to play back, ogg/theora, ~8,7M MBytes)

By the way

I'm attending GUADEC

libpanel-applet3

I’ve finally found some time to blog about this. The bonobo-less gnome-panel branch was merged into master, so since version 2.31.2 gnome-panel doesn’t depend on bonobo anymore. The API is mostly the same, but there are some minor changes since the old API exposed bonobo stuff. This of course means that applets need to be ported to the new API. There’s already a GNOME Goal with a porting guide, and I already ported most of the gnome-applets so there are a few examples too.

Why I can’t use GNOME Shell


GNOME Shell
GNOME Shell

This is GNOME Shell running without any other application running except GNOME System Monitor. The CPU usage is always around 60%, which makes the system unusable after a few minutes. I guess it’s actually an issue of the nvidia drivers, but the fact is that I can’t use GNOME Shell.

GNOME Panel
GNOME Panel

And this is GNOME Panel. Maybe I’m too used to it, but I really like the old panel approach, and my applets, specially the workspace switcher. I have never seen a better way to change between workspaces than the current workspace switcher applet, it’s fast and intuitive.

By the way, the screenshot shows a special GNOME Panel, it’s bonobo-free! A few years ago I already tried to port libpanel-panel from bonobo to D-Bus, but at that time breaking compatibility with bonobo applets was not accetable. Now we really want to get rid of bonobo in GNOME 3, and I’m not the only one who can’t use GNOME Shell, so GNOME Panel is not going to die in a near future. I’ve already proposed an updated patch for gnome-panel, the challenge now is porting all the applets which might be a new GNOME Goal.

Evince 2.27.1 with preliminary annotations support

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
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! 🙂

Evince 2.26 without annotations

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.

PolicyKit and CPUFreq Applet

The frequency selector menu has been implemented for a long time now however, there are still people who don’t know such a feature exists. The problem is that it uses a helper program that has to be installed with the suid bit enabled and it seems that some distros don’t do that by default.

Now that PolicyKit has been proposed as an external GNOME dependency, I’ve decided to give it a try. Yesterday I committed a patch to gnome-applets to use PolicyKit (when it’s available) in the cpufreq applet, so that we don’t need to enable the suid bit in cpufreq-selector anymore. The selector menu will be always available by default now. An authentication dialog, provided by PolicyKit-gnome, will pop up when a non-admin user tries to use the selector menu.

PolicyKit-gnome authentication dialog
PolicyKit-gnome authentication dialog

Don’t worry too much about the annoying popup dialog, since the authentication can be remembered forever, so that if you want, you will only see this popup dialog the first time.