Evince Hackfest

The Evince hackfest took place last week from 23rd to 25th July in Strasbourg. Yes, 3 days only, but very productive in my opinion, I’ll summarize all the cool stuff we worked on.

HiDPI

This work was initially started by Owen, and then Germán kept the patches up to date with evince git master. I reviewed all the pending patches and updated the thumbnails one and the result is that evince doesn’t look blurry on HiDPI screens any more.

Evince running with GDK_SCALE=2

Evince running with GDK_SCALE=2

Recent View

This was a GSoC project of 2013, but the patch provided by the student was never in an “upstreamable” state. Again Germán, who always loved this feature, took care of the patch addressing my review comments. At the beginning of the hackfest most of the work has already been done, we only needed a few more review iterations during the hackfest to finally push this feature to master. The idea is to show the list of recent documents as an icon view with thumbnails and documents metadata. This view is loaded when evince is launched without any document replacing the useless empty window we had before. It also replaces the recent documents submenu in the gear menu.

Evince Recent View

UI improvements

The move to the header bar recently made the toolbar look a bit cluttered, mainly because the title might use a lot of space. We discussed several ideas to improve the header bar and implemented some of them:

Evince header bar improvements

 

Juanjo Marín also wrote a patch to change the default zoom mode to “Automatic”, since several people commented that the current “Fit Width” mode doesn’t look good in screens with higher resolutions. The patch is still waiting review.

Annotations

Giselle and Anuj, our GSoc students this year, worked on their projects to improve the annotations support in both Evince and poppler.

    • Anuj wrote some patches to add support for Free Text annotations to poppler glib API. After a couple of review iterations and discussions about the API, the patches are now in bugzilla waiting for a final review (I hope to find the time soon)
    • Giselle was focused on adding support for highlight annotations to Evince, since poppler already has all the required API for this. The patches are not yet ready, but they look really promising.

 

Caret navigation and accessibility

Joanie and API continued improving the evince a11y support and fixing some remaining issues from the FoG project. Antía fought with the caret navigation implementation again to implement some missing key bindings and fixing other issues.

Comics backend

Juanjo Marín focused on the comics backend, working on a patch to use libarchive to uncompress the documents instead of spawning external command line tools.

Gestures

I started to review the gestures branch during the hackfest, patches looked clean and simple, but since I was not familiarized with the new GTK+ touch API and I didn’t have a touch screen to try it out either, I decided to wait after the hackfest and see it in action in garnacho’s laptop during GUADEC. Carlos explained to me how the touch API works in GTK+ and I could check it actually works great. The code doesn’t affect the normal use with the mouse, so the branch will be merged in master soon.

Evince hackfest dinner

And of course not everything was hacking

THANKS!

Many thanks to Alexandre Franke for the local organization, everything worked perfectly. Of course thanks to the GNOME Foundation for sponsoring the GSoC students, Giselle and Anuj, and Igalia for sponsoring all the Igalians attending the hackfest. Thanks also to Epitech for allowing us to do the hackfest there before the GUADEC.

Igalia S.L. GNOME FoundationEPITECH

GDK API removed from poppler-glib

GDK dependency has been optional since poppler 0.8 and the API was deprecated in 0.16. I’ve just removed the GDK dependency in current git master so poppler 0.18 will only depend on glib and cairo.

If you are still using the GDK API, please port it to cairo before 0.18 (scheduled for June 27). GDK API in poppler 0.16 is just a wrapper around the cairo one, so you can even copy and paste the code if you still need to render into a GdkPixbuf.

If you need help, feel free to ask anything in poppler mailing list or #poppler channel in freenode.

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

Extracting images with Evince

Finally, the patch I wrote to allow extracting images from a PDF has been applied to poppler cvs head (thanks Albert). Evince already supports this feature since 0.7.1 version. Here is a screencast.

Evince images handling
(click to play back, ogg/theora, ~3.0 MBytes)

Images selection is not supported yet, but I’m already working on it 😉

Evince images selection
Select images

Google Summer of Code 2007

The list of approved projects has been announced!. Iñigo Martínez, a student from the Universidad del País Vasco, is going to be my student to implement annotations support in Evince. We received more than ten proposals to implement annotations support so the final decision hasn’t been easy. I’ve been talking with Iñigo and he seems to be very motivated so I’m quite sure the project is not going to fail this year. Now is time to work and enjoy hacking!

Evince

A few days ago, juanjo talked to me about beamer, a LaTeX class for creating presentations. It’s awesome! You can install it from ubuntu/debian repositories and it comes with a lot of useful themes. Beamer is thought to be used with pdflatex to generate the output, so it uses some pdf features like specialized links.

The other day I noticed that evince doesn’t support all of the links included in a pdf generated by beamer. Concretely the links that are called in the PDF Reference as “Named Actions”. The named actions that a document viewer is expected to support are NextPage, PrevPage, FisrtPage and LastPage, although there could be additional, nonstandard actions, like Find or GoToPage which are used by beamer.

Poppler already supports Named Actions, but poppler-glib doesn’t. I’ve added support for them in poppler-glib and then in evince too. Since we are “freezed” right now, we have to wait until branch for 2.16 to be able to check it in.

I have started a campaign in GSyC in favour of evince, since many people are still using xpdf. At the moment it seems that grex is convinced as well as acs who didn’t have to be convinced indeed. The big problem is that most of them are using old evince versions, so I’m pretty sure that, when they upgrade to dapper (at least ubuntu users) and try it out again, they all will change their opinion about evince.