Monday, July 4, 2011

Extracting text from pdf files

Recently found the mupdf package, which is a free pdf-viewer and utility package, at www.mupdf.com.
Binaries can be downloaded for Windows and Linux and looks like the Mac version can be built from source also.

On Ubuntu Linux it can also be installed using the package manager :
sudo apt-get install mupdf-tools

One of the utilities is called pdfdraw. It can render the pages of a pdf file in a few image formats.
The -t command line switch can be used to dump out the text from the pages to the standard output. From there it's simply the matter of redirecting to a file:
pdfdraw -t filename.pdf > filename.txt

Thursday, August 13, 2009

Saving/Printing Google Reader stories through PrintFriendly.com


Recently Google Reader added a new feature, 'Send To', that can be configured on the Reader Settings page. 'Send To' lets you pass the original article's URL to a few predefined online sites and services.

Luckily, in addition to the predefined sites, it is also possible to add and configure custom services that you'd like to process the URL with.
One of my favorite pages is PrintFriendly.com, that can print a page or post after stripping away content that is not part of the main article. It can also save the page as a PDF file.
So right away I tried to create an custom 'Send To' item for Google Reader, that lets me forward the article to PrintFriendly for processing.

All you have to do is go to the 'Send To' tab on the Settings page, click on the 'Create a custom link' button at the bottom and enter the following information:

Name : PrintFriendly
URL : http://www.printfriendly.com/print?url=${url}
Icon URL : http://cdn.printfriendly.com/pf-icon.gif

and click save.
After that, when you read an article in the Reader, the Send To list at the bottom will include the PrintFriendly option, in addition to the others you enabled. Clicking it will bring up the PrintFriendly.com page with the article already loaded and cleaned up. You can do further editing before printing or saving to PDF.

Wednesday, April 8, 2009

N 6100 linux framebuffer driver


I finally sorted out the underlying spi master/slave setup issues and were able to start working on a linux framebuffer driver.
The first version can be downloaded from the link below. It is a fairly standard framebuffer driver, based on the skeletonfb sample module. After the module is loaded it should create the /dev/fb0 device node. The node can then be used to send data (image data mostly) to te screen.
(mmap-ed write access is not supported right now, the write() function can be used to send image data to the screen in a similar fashion.)
If the fbcon driver is built into the kernel, it can also use this driver and turn the lcd into a small console screen (see image on the right).
More information about rebuilding the driver and module parameters can be found in the README.txt file in the archive.

Download : n6100fb-0.01.tar.gz

Thursday, July 17, 2008

Nokia 6100 Test utility

I haven't quite gotten to the framebuffer driver part yet, but in the meantime I came up with this user mode application that displays some graphics and a bitmap on the Nokia lcd screen.
Basically it is the combination of the two separate test apps (lcdtest & lcdimg) included in the driver, described in the previous post.
The main difference is that this program doesn't require any drivers to access the screen, it initializes and uses the pxa255 ssp controller to communicate with the screen.
By default it assumes the screen uses an Epson controller. To use with Phillips controllers, only a simple change is required: in the main() function, the first parameter of the lcdInit() call has to be changed from 1 to 0.
The program draws some simple graphics : lines, circles, text. And it also loads and display a bitmap from raw image file. Therefore it is important to transfer the cat.rgb file to the target, together with the executable.

Download : nokiatest-0.01.tar.gz

It can be seen in action below :

Now it's really time to get that framebuffer driver going ...

Thursday, May 15, 2008

Nokia 6100 Lcd Linux Driver

This is a Linux driver for the Nokia 6100 compatible LCD screen ( I got mine from Sparkfun Electronics ).
I wanted to get it working with my Viper-Lite development board, which runs Linux. Since I didn't find a driver already available, I figured a take a crack at writing one myself. ssplcd is the driver I ended up with. It is published under the GNU General Public License, without warranty or support.

The Viper-Lite uses a PXA 255 processor, and I do know about the Gumstix driver, which is for Linux and the same processor. But I wanted something more generic, that can be used by applications to access the screen.

My driver is a kernel module (tested with 2.6.24.3) also, but - after it has been loaded - it can be used by applications to access the screen as a file, send ioctl commands to it and write data to it.
It has only been tested with my devel board, using the PXA 255 processor, so I'm not sure about any other kind of hardware. But it should work ok with other PXA 255 based systems, like the Gumstix computers.

Also, my lcd has an Epson controller, so it hasn't been tested with Phillips controllers at all.
There's more information available in the README in the archive.

Download : ssplcd-0.01.tar.gz

I know that the current programming interface is a bit awkward. If I'll have enough time, I want to look into writing a different, framebuffer driver for the same device.

Update: you may also be interested in the linux framebuffer driver here.