首页 > 代码库 > linux shell assemble PDF文件

linux shell assemble PDF文件

 
daniel@daniel-mint ~/latex/linux/itext/daniel $ cat asm.sh header_start=0header_len=15xref_start=$(strings -a -t d $1 | grep -e "\bxref\b" | awk ‘{print $1}‘)trailer_start=$(strings -a -t d $1 | grep -e "\btrailer\b" | awk ‘{print $1}‘)#echo $xref_start#echo $trailer_startxref_len=$(echo "$trailer_start - $xref_start" | bc)#echo $xref_lenheader_dump=$(echo "$1" | sed -re ‘s/^(.*)\.pdf/asm\_\1\_header\.bin/g‘)dd if=$1 of=$header_dump bs=1 skip=$header_start count=$header_lenxref_dump=$(echo "$1" | sed -re ‘s/^(.*)\.pdf/asm\_\1\_xref\.bin/g‘)dd if=$1 of=$xref_dump bs=1 skip=$xref_start count=$xref_len