Page 1 of 1
alternating pages
Posted: 14 Dec 2011, 02:02
by tarakan114
I ran across this kind of problem:
After I shoot all the pages, I use Fine reader 10 for OCR.
Than I end up with a PDF file that has all the left and all the right pages separately.
How do I intertwine those pages?
Is there any way to keep track of the page number in case I forget a page?
Re: alternating pages
Posted: 21 Dec 2011, 14:57
by pav
Looks like a job for:
http://www.sheelapps.com/index.php?p=P ... ction=view
I have not tried it yet but from the description:
'Split PDF :
This option allows you to split a PDF file in multiple ways. You can split each page to new PDF, split even pages to new PDF, split odd pages to new PDF, split after given page number, split at every given page count or split a range of pages to new PDF file. '
and also:
Join PDFs :
This option allows you to create a PDF file by joining multiple PDF files.
and
Rearrange PDF :
This option allows you arrange pages in a PDF file. You can reverse all pages, copy multiple pages on single page or create handout style pages.
There is also:
http://www.paologios.com/products/?type=bin
Both freeware, the latter also Opensource.
Hope it helps.
Re: alternating pages
Posted: 21 Dec 2011, 15:00
by pav
On a second thought may be a simpler solutin is to change the way you arrange or name your pictures files before you feed them to the OCR?
Re: alternating pages
Posted: 24 Dec 2011, 13:29
by dingodog
tarakan114 wrote:I ran across this kind of problem:
After I shoot all the pages, I use Fine reader 10 for OCR.
Than I end up with a PDF file that has all the left and all the right pages separately.
How do I intertwine those pages?
Is there any way to keep track of the page number in case I forget a page?
use my script in linux (it relies on
pdftk)
http://pastebin.com/P9uc84Ya
your
first pdf is pdf file with
right pages
(odd)
your
second pdf is pdf file with
left pages
(even)
Code: Select all
#!/bin/sh
#script able to interleave the pages of two pdf files, saving the result in a new pdf file. Useful for any use, specially to mount parallel text books
echo "enter the name (with extension) of first PDF"
read filename1
echo "enter the name (with extension) of second PDF"
read filename2
pages1="`pdftk $filename1 dump_data output |grep Pages|cut -f2 -d :`"
pages2="`pdftk $filename2 dump_data output |grep Pages|cut -f2 -d :`"
if [ $pages1 -ge $pages2 ]
then
pagesincr="$(echo "scale=0; $pages2+1" |bc -l)"
echo "$filename1 has $pages1 pages"
echo "$filename2 has $pages2 pages"
rule="$(for x in $(seq 1 $pages2); do echo -n "A$x B$x "; done; for x in $(seq $pagesincr $pages1); do echo -n "A$x ";done)"
echo $rule
elif
[ $pages2 -ge $pages1 ]
then
pagesincr="$(echo "scale=0; $pages1+1" |bc -l)"
echo "$filename1 has $pages1 pages"
echo "$filename2 has $pages2 pages"
rule="$(for x in $(seq 1 $pages1); do echo -n "A$x B$x "; done; for x in $(seq $pagesincr $pages2); do echo -n "B$x ";done)"
echo $rule
else
echo "$filename1 has $pages1 pages"
echo "$filename2 has $pages2 pages"
rule="$(for ((a=1, b=1; a <= $pages1, b <= $pages2 ; a++, b++)); do echo -n "A$a B$b "; done)"
echo $rule
fi
pdftk A=$filename1 B=$filename2 cat $rule output interleaved.pdf
echo "file created!"
exit 0