parameters: (pdf)
docstring: 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
docstring_summary: 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
docstring_tokens: 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
function: 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()
function_tokens: 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 ( )