From Texas Instruments Wiki
PDF Viewers are needed for many applications, such as e-books. Desirable features include zoom and rotation. Below are simple instructions to use a DM335 (or other DaVinci ARM9s) as a PDF Viewer.
There are several open source programs that allow you to view the PDF directly, but from our experience, these perform worse than if we convert the PDF to JPEG, and then use a JPEG Viewer. One such PDF Viewer (not requiring JPEG conversion) that we were able to run was ePDF.
PDF Viewer using a JPEG Viewer
- First, you'll need to compile fbida, a JPEG_Viewer and configure your kernel
- On your host, download Ghostscript, then untar the file. To compile:
- host# cd ghostscript-x.xx
- host# ./configure
- host# make
- host# make install
- Find a PDF you'd like to convert - Internet searching should yield some classic books
- Create the JPEG's you'll view on the target by:
- host# mkdir /my/target/fs/my_favorite_book and host# cd /my/target/fs/my_favorite_book
- host# gs -sDEVICE=jpeg -dFirstPage=2 -dLastPage=11 -o out-%03d.jpg /path/to/my_favorite_book.pdf - select the pages you want converted, or remove the -dFirstPage and -dLastPage. If you have more than 1000 pages, you'll need to change your %03 accordingly.
- Boot your EVM with your file system containing your JPEG files and kernel/bootargs as outlined at JPEG_Viewer
- View your JPEG files now using: target# fbi /my_favorite_book/*.jpg -d /dev/fb/0 --edit
- To flip between pages, use pg-up or pg-down, to zoom, use + or -, with shift-r and shift-l for rotation.
- If you notice some extra lines in the JPEG output, make the following change: echo 0x20000020 0x30 > /sys/class/davinci_system/system/reg where 0x30 can range from 0x10 to 0x50
Some other ideas...
- To speed functions like rotation on JPEG images, you can use the DaVinci optimized rotation library
- If you are using a LCD, switch to progressive for viewing text by changing VENC Register 0x1C70400 to 0x403 from 0x3 (interlaced)