(pdf)
Rotate clockwise PDF (90°) into a new PDF.
    Note that the attachments are not copied.
    :param pdf: a PDF to rotate
    :return: a PDF rotated
Rotate clockwise PDF (90°) into a new PDF.
    Note that the attachments are not copied.
    :param pdf: a PDF to rotate
    :return: a PDF rotated
Rotate clockwise PDF ( 90° ) into a new PDF . Note that the attachments are not copied . : param pdf : a PDF to rotate : return : a PDF rotated
def rotate_pdf(pdf):
    ''' Rotate clockwise PDF (90°) into a new PDF.
    Note that the attachments are not copied.
    :param pdf: a PDF to rotate
    :return: a PDF rotated
    '''
    writer = PdfFileWriter()
    reader = PdfFileReader(io.BytesIO(pdf), strict=False)
    for page in range(0, reader.getNumPages()):
        page = reader.getPage(page)
        page.rotateClockwise(90)
        writer.addPage(page)
    with io.BytesIO() as _buffer:
        writer.write(_buffer)
        return _buffer.getvalue()
def rotate_pdf ( pdf ) : writer = PdfFileWriter ( ) reader = PdfFileReader ( io . BytesIO ( pdf ) , strict = False ) for page in range ( 0 , reader . getNumPages ( ) ) : page = reader . getPage ( page ) page . rotateClockwise ( 90 ) writer . addPage ( page ) with io . BytesIO ( ) as _buffer : writer . write ( _buffer ) return _buffer . getvalue ( )