Interleave merge pdf files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chirayu Krishnappa

    Interleave merge pdf files

    Hi,

    I need to scan documents with pages having printed matter on both
    sides. It is easiest to stack them in the autosheet feeder and let it
    scan. I end up with one file (say A.pdf) containing the odd pages in
    sequence. Similarly, I can end up with B.pdf containing the even pages.
    I want to combine them into result.pdf which contains A.1, B.1, A.2,
    B.2, A.3, B.3, ... (A.1 = page 1 of A.pdf).

    Does someone know a simple way to achieve this? I noticed the other
    thread on this newsgroup about merging lots of pdf files and
    multivalent tools and pdftk were mentioned. However, I could not find a
    way to do this using them. I am interested in another free tool or a <
    25 lines python script (which may use any freeware library) to do the
    same.

    Thanks,
    Chirayu.

  • Mark Jackson

    #2
    Re: Interleave merge pdf files

    "Chirayu Krishnappa" <chirayuk@gmail .com> writes:[color=blue]
    > Hi,
    >
    > I need to scan documents with pages having printed matter on both
    > sides. It is easiest to stack them in the autosheet feeder and let it
    > scan. I end up with one file (say A.pdf) containing the odd pages in
    > sequence. Similarly, I can end up with B.pdf containing the even pages.
    > I want to combine them into result.pdf which contains A.1, B.1, A.2,
    > B.2, A.3, B.3, ... (A.1 = page 1 of A.pdf).
    >
    > Does someone know a simple way to achieve this? I noticed the other
    > thread on this newsgroup about merging lots of pdf files and
    > multivalent tools and pdftk were mentioned. However, I could not find a
    > way to do this using them. I am interested in another free tool or a <
    > 25 lines python script (which may use any freeware library) to do the
    > same.[/color]

    I face exactly the same problem. Based on examination of the pdftk man
    page I *think* it can be done by something like (untested):

    pdftk A.pdf burst output %04d_A.pdf
    pdftk B.pdf burst output %04d_B.pdf
    pdftk *_?.pdf cat output combined.pdf

    assuming fewer than 10,000 pages per document, of course.

    I would be interested in an alternative approach which does not
    generate a ton of intermediate pdfs.

    --
    Mark Jackson - http://www.alumni.caltech.edu/~mjackson
    It is difficult for men in high office to avoid
    the malady of self-delusion. - Calvin Coolidge


    Comment

    • ssteward@accesspdf.com

      #3
      Re: Interleave merge pdf files

      Mark Jackson wrote:[color=blue]
      > "Chirayu Krishnappa" <chirayuk@gmail .com> writes:[color=green]
      > > Hi,
      > >
      > > I need to scan documents with pages having printed matter on both
      > > sides. It is easiest to stack them in the autosheet feeder and let it
      > > scan. I end up with one file (say A.pdf) containing the odd pages in
      > > sequence. Similarly, I can end up with B.pdf containing the even pages.
      > > I want to combine them into result.pdf which contains A.1, B.1, A.2,
      > > B.2, A.3, B.3, ... (A.1 = page 1 of A.pdf).
      > >
      > > Does someone know a simple way to achieve this? I noticed the other
      > > thread on this newsgroup about merging lots of pdf files and
      > > multivalent tools and pdftk were mentioned. However, I could not find a
      > > way to do this using them. I am interested in another free tool or a <
      > > 25 lines python script (which may use any freeware library) to do the
      > > same.[/color]
      >
      > I face exactly the same problem. Based on examination of the pdftk man
      > page I *think* it can be done by something like (untested):
      >
      > pdftk A.pdf burst output %04d_A.pdf
      > pdftk B.pdf burst output %04d_B.pdf
      > pdftk *_?.pdf cat output combined.pdf
      >
      > assuming fewer than 10,000 pages per document, of course.
      >
      > I would be interested in an alternative approach which does not
      > generate a ton of intermediate pdfs.
      >[/color]

      Here is a page that offers a couple related scripts (one bash script,
      one DOS batch script) for doing this with pdftk in one swipe:



      Sid

      Comment

      Working...