Please note the wiki will be in Read Only mode for a software upgrade on Thursday, January 29, 2015 from 11:00am CST until 12:00pm CST. Occasional site outages could occur. Removal of this site notice will signify that the wiki is back in Read/Write mode.

PDF Viewer

From Texas Instruments Wiki
Jump to: navigation, search


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

  1. First, you'll need to compile fbida, a JPEG_Viewer and configure your kernel
  2. On your host, download Ghostscript, then untar the file. To compile:
    1. host# cd ghostscript-x.xx
    2. host# ./configure
    3. host# make
    4. host# make install
  3. Find a PDF you'd like to convert - Internet searching should yield some classic books
  4. Create the JPEG's you'll view on the target by:
    1. host# mkdir /my/target/fs/my_favorite_book and host# cd /my/target/fs/my_favorite_book
    2. 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.
  5. Boot your EVM with your file system containing your JPEG files and kernel/bootargs as outlined at JPEG_Viewer
  6. View your JPEG files now using: target# fbi /my_favorite_book/*.jpg -d /dev/fb/0 --edit
  7. To flip between pages, use pg-up or pg-down, to zoom, use + or -, with shift-r and shift-l for rotation.
  8. 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...

  1. To speed functions like rotation on JPEG images, you can use the DaVinci optimized rotation library
  2. If you are using a LCD, switch to progressive for viewing text by changing VENC Register 0x1C70400 to 0x403 from 0x3 (interlaced)