def crop(id): '''crop pdf file in books/new/${id}.pdf''' srcPath = os.path.join(os.path.curdir, 'books', 'new', id+'.pdf') destPath = os.path.join(os.path.curdir, 'books', 'new', id+'.cropped.pdf') DuoPdf.cropWH(destPath, srcPath, 500, 666) os.remove(srcPath) os.rename(destPath, srcPath)
def crop(id): '''crop pdf file in books/new/${id}.pdf''' srcPath = os.path.join(os.path.curdir, 'books', 'new', id + '.pdf') destPath = os.path.join(os.path.curdir, 'books', 'new', id + '.cropped.pdf') DuoPdf.cropWH(destPath, srcPath, 500, 666) os.remove(srcPath) os.rename(destPath, srcPath)
def cropSingle(src): '''crop pdf file''' srcPath, ext = os.path.splitext(src) destPath = srcPath + '_c' + ext DuoPdf.cropWH(destPath, src, 500, 666)