(e-mail address removed) schreef:
I would like to take 2 pdf files that i have created and combine them
into a single pdf.
Is this possible ?
I once did something like this with awk. It combines 2 documents,
renumbering the pages, so that the pages of the two documents become
interleaved. With two-sided printing, page 1 of doc 1 and page 1 of doc
2, printed on the same piece of paper. The resulting PDF is also useful
as a backup, for browsing.
Let me search...
My PDF-sources were created by cygwin/ps2pdf, the PS-sources were
createted by printing-to-file with an HP Laserjet PS driver on a Windows
system.
Wo, this is old:
### cln.awk:
BEGIN { FS = "\001" }
{ print $2 }
### ltf.awk:
BEGIN {
FS=" "
P = 0
L = 0
}
/^%%Trailer/, /^\004%-12345X/ { next }
/^%%Page:.*/ {
L = 1
P = 2*($3-1)+1
printf( "%04d%04d\001", P, L)
print $1 " " P " " P
next
}
/^\(%%\[Page:.*/ {
++L
printf( "%04d%04d\001", P, L)
$2 = P "]%%)"
print
next
}
{
++L
printf( "%04d%04d\001", P, L)
print
}
### rgt.awk:
BEGIN {
FS=" "
P = 0
L = 0
M = 0
}
/^\033%-12345X@PJL/, /^%%EndSetup/ { next }
/^%%Page:.*/ {
P = 2 * $3
M = P
L = 1
printf( "%04d%04d\001", P, L)
print $1 " " P " " P
next
}
/^\(%%\[Page:.*/ {
++L
printf( "%04d%04d\001", P, L)
print $1 " " P "]%%) ="
next
}
/^%%Pages:.*/ {
++L
printf( "%04d%04d\001", P, L)
$2 = M
print
next
}
{
++L
printf( "%04d%04d\001", P, L)
print
}