any lib to extract pages form pdf and then merge?

oyster lepto.python at
Tue May 26 00:47:29 EDT 2009

I want to extract some pages from vary pdf files, then write them
with/witout rotation into one new pdf file. something likes this
import gfx
doc ="pdf", r"Theory.pdf")
pdf = gfx.PDF()
for pagenr in [1,5,7]:
    page = doc.getPage(pagenr)

    if pagenr==1:
        page.rotate(90)                                         #for some pages

    pdf.startpage(page.width, page.height)
    pdf.endpage()"new pdf.pdf")

I have tried pypdf, but it errs and exits on some of my pdfs(no, the
files have no password)

can someone suggest on such a lib for python on windows/or a pure C-dll?
(I mean pdf page->pdf, not pdf page->pic->pdf)


More information about the Python-list mailing list