04.26.06

Threading problems

Posted in Projects, ePDFView at 8:49 pm by Jordi Fita

In hoping to improve the user interface of ePDFView I’m trying to adding a little of threading so loading the document and rendering pages will be done in background.The problem? Either I’m too stupid or threads are difficult (or both, which is more probable.) I mean, Glib has a great support for threading, but when I have a problem with the application (which seems random now) I don’t know where to look to.

Also, adding threads to the application makes the automated tests a lot more difficult and slower: I have to wait for the document to load, which is done by a different thread so I don’t really know when or how it will end. For now I put some sleep() statements which obviously makes the test slower than it should.

I only hope that I learn from all this :-)

04.24.06

Released version 0.1.3

Posted in Projects, ePDFView at 2:12 pm by Jordi Fita

Today I’ve released version 0.1.3 of ePDFView. This version is just a minor enhancement update and some bug fixes. I didn’t add any new feature in this version, but fixed some annoyances like mouse scrolling, single click on outlines and save current window’s position and size.

Actually I had to make a new tarball after the release because I did use Glib’s g_file_set_content() function to save the configuration file. As I’ve been pointed by Mr_Moustache, this function is only available on Glib version 2.8.x. Since I want to keep the current depence on GTK+ version 2.6.x I had to change it.

04.20.06

Towards version 0.1.3

Posted in Projects, ePDFView at 5:25 pm by Jordi Fita

After the release of version 0.1.2 of ePDFView, which uses Poppler’s glib wrappers, last Monday I have received a lot of support emails and some bug reports of users.

Being my first public open source project, I’m very pleased by the reaction and this makes me work on version 0.1.3 very motivated :-)

I think this new version won’t have a lot of new features, mainly I’ll fix some odd behaviour like single click to select and index or mouse wheel scrolling, although I’m planning to add features like search and thumbnailing on later version.

What I really need to do, though, is learn how to use Trac’s roadmap, so all those ideas will become a little more clear than what can I write on a blog’s post :-)

Anyway, since this version is mainly a “bugfix/minor enhancements” release I hope release it at the end of next week.

04.16.06

Poppler’s glib bindings

Posted in Projects, ePDFView at 10:46 pm by Jordi Fita

Since the public release of ePDFView on freshmeat and GnomeFiles I have received users comments about ePDFView not compiling.It seems that Poppler won’t support the old Xpdf header files anymore and don’t install them unless the –enable-xpdf-headers option is passed to the configure script. But the worst of all is that CairoOutputDev.h file is not installed on Poppler version 0.5.1. Since I use version 0.5.0 I didn’t notice that.

So, the first thing to do for the next version is use the glib bindings of Poppler, that seems to be the only way for GTK+ applications to use Poppler in future versions.

Anover Version of ePDFView

Posted in Projects, ePDFView at 5:51 pm by Jordi Fita

Today I’ve released another version of ePDFView, version 0.1.1.

This new version features the document’s outline, as I told yesterday, and also loading file names passed as command line parameters. This is an important because this means I can use ePDFView to load Internet PDF documents directly from the web browser.

This time also I’ve announced this release on freshmeat, hoping that someone else will find it useful. I’m also thinking to make an autopackage file for it depending on the feedback I get, if any, although I like the idea of relocatable applications anyway.

04.15.06

Document Outline

Posted in Projects, ePDFView at 9:28 pm by Jordi Fita

I have updated the ePDFView’s code to load and display the PDF document’s outline, if it has any. I haven’t released the code yet, it’s only available on the Subversion repository.Actually, reading the document’s outline using Poppler was easier than what I thought, once I read the PDF reference and I understood enough of it. I also wrote test cases for it and also test cases for displaying it on the application’s main view, as always.

I also fixed the problem that I had with the memory requirements to compile the test suite. It turns out that the compiler would run out of main memory because the test cases were too long. I really need a new development computer, or at least with more RAM :-)

If everything goes right, tomorrow or Monday I’ll release version 0.1.1 of ePDFView, with the outline code and some other “annoyances” fixed.

04.13.06

PDF Viewer released

Posted in Projects, ePDFView at 5:39 pm by Jordi Fita

I’ve released the first version of ePDFView, the lightweight PDF viewer. As this is the first version don’t expect too much for the application. It’s just a viewer, althought you can zoom and rotate the document.There are still a lot of thinks to do for the next version: thumbnails, page index, links, make the backend render the pages faster, render the pages in background… but over all of then I must reduce the memory requirements for compiling the test suite.

I don’t know why but when I compile the test suite the compiler takes out all the free memory and my computer becomes unresponsive (i.e., is swapping all the time.) I really don’t know if it’s a bug of the compiler (possible but not probable), something I don’t know about CppUnit or my MVP implementation (very probable). I’ll find out in the following days, I hope ;-)

04.11.06

Half PDF Viewer

Posted in Projects, ePDFView at 7:17 pm by Jordi Fita

Finally I’ve decided to start working on the lightweight PDF viewer I talked about last sunday.

Sure, it won’t have the same features that other better document viewers, like Evince, but it will only depend on Poppler and GTK+. Although the way I do my GUI application should let change the GTK+ part for any other toolkit (even raw Xlib!) without too many changes to the application.

What I do for my GUI application is follow the Model View Presenter (MVP) model, which is very similar to the Model View Controller (MVC), but the View layer is much thinner in the MVP than in the MVC. In fact the View layer is just a dumb layer that passes all events to the presenter and waits for the presenter to make a decision.

Since the Model is only the current application’s data, it means that all logic is concentrated in the Presenter. It makes a lot easier to test the logic when it’s on a single place and, since the view is so thin, it’s possible to develop almost the whole application using Test Driven Development (TDD).

That’s why I say I have half PDF Viewer: I have coded all application logic inside the Presenter and tested it using CppUnit. It works, but don’t show anything interesting yet, besides the white dots on the black console (unless you are using a GUI front end, in which case green bars appears!).

I plan to spend tomorrow creating the “GTK shell” that will make the PDF’s visible and perhaps Thurday I will release the first version.

04.09.06

Lightweight PDF Viewer

Posted in Projects, ePDFView at 6:29 pm by Jordi Fita

From time to time I need to read a PDF file I downloaded from Internet. Since I’m not using one of the “big” desktop environments like KDE or Gnome, I didn’t have any PDF viewer installed.

I’m running Gentoo on a fairly low end computer (Pentium III 1GHz with 128MiB of RAM) so I installed Fluxbox as my window manager, hoping to go away from the bloat of desktop environments. That means that I’m not an enthusiastic of installing additional libraries just to view PDF: Evince and KPDF aren’t options.

I installed Adobe Acrobat Reader for GNU/Linux but it’s so slooow… that I try to avoid opening PDF files as much as I can because only the program’s loading time gets on my nerves.

Unfortunately I’m unable to find a lightweight PDF viewer that doesn’t require useless, from my point of view, libraries. So, I’ll try to write a simple PDF viewer using GTK+ and Poppler, a PDF library born as a fork of Xpdf.

I already wrote a prototype GTK+ application that using Poppler shows the first page of any PDF file I try. So I don’t think this project is insane or out of my skills. I just need to make it robust and easy to add features (I still can’t figure how to do searches, for example). I’ll see :-)