TinyApps.Org
Small is beautiful


 HOME

  0. Internet
  1. Text
  2. Graphics
  3. System
  4. File
  5. Misc
  6. Palm
  7. OS X

 BLOG

 DOCS

 FAQ

 RSS (?)





Delete multiple pages in a DjVu document with djvm #
djvm (a command line tool bundled with DjVuLibre), does not accept multiple pages or page ranges for the delete argument. Here are a few workarounds for deleting all pages in a range, even pages, or odd pages:
  • Delete pages 1-42
    for i in $(jot 42 1) ; do djvm -d file.djvu 1 ; done
  • Delete pages 441-449
    count=441 ; until [ $count -gt 449 ] ; do djvm -d file.djvu 441 ; count=`expr $count + 1` ; done
  • Delete even pages 204 to 2
    for (( COUNTER=204; COUNTER>=2; COUNTER-=2 )) ; do djvm -d file.djvu $COUNTER ; done
  • Delete odd pages 329 to 105
    for (( COUNTER=329; COUNTER>=105; COUNTER-=2 )) ; do djvm -d file.djvu $COUNTER ; done
Many thanks to DutchDaemon and s0xxx for their answers in this thread, and to SilentGhost for this answer on Stack Overflow.

/nix | Feb 15, 2010



Categories
/blosxom
/eink
/mac
/misc
/nix
/palm
/windows

Blosxom Archive
2013: 5 4 3 2 1
2012: 12 11 10 9 8 7 6 5 4 3 2 1
2011: 12 11 10 9 8 7 6 5 4 3 2 1
2010: 12 11 10 9 8 7 6 5 4 3 2 1
2009: 12 11 10 9 8 7 6 5 4 3 2 1
2008: 12 11 10 9 8 7 6 5 4 3 2 1
2007: 12 11 10 9 8 7 6 5 4 3 2 1
2006: 12 11 10 9 8 7 6 5 4 3 2 1
2005: 12 11 10

Blogger Archive
2005: 10 9 8 7 6 5 4 3 2 1
2004: 12 11 10 9 8 7 6 5 4 3 2 1
2003: 12 11 10 9 8 7 6

Ezine Archive
2004: 4 3 2 1
2003: 12 9 8 7 6 5 4 2 1
2002: 12 10 9 8 7 6 5 3 2 1
2001: 12 11 10