20 Feb 2005 zhaoway   » (Master)

这好像是以前carlos告诉我的嘞。

put in ~/.bashrc

pdfbrk()
{
    xtitle "pdftk"
    if [ ! -f ${2}.pdf ]; then
        echo "Usage: pdfbrk NUMBER FNAME"
        echo "NUMBER is the total number of all pages"
        echo "FNAME is basename of a PDF without .pdf"
        echo "Example: pdfbrk 1978 dictionary"
        echo "Suppose dictionary.pdf has 1978 pages in total."
        echo "Output will be dictionary.1-13.pdf"
        echo "               dictionary.11-23.pdf"
        echo "               etc."
        return
    fi
    for i in `/usr/bin/seq 1 10 ${1}`; do
        j=$(($i+12))
        if [ $j -gt ${1} ]; then
            j=end
        fi
        /usr/bin/pdftk ${2}.pdf cat $i-$j output ${2}.$i-$j.pdf
    done
}

to help me read big pdf files on screen. i just easily got tired after every 10 pages. ;)

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!