Downloads this file to the local drive. Can download the
        file in chunks with multiple requests to the server.

        :param to_path: a path to store the downloaded file
        :type to_path: str or Path
        :param str name: the name you want the stored file to have.
        :param int chunk_size: number of bytes to retrieve from
         each api call to the server. if auto, files bigger than
         SIZE_THERSHOLD will be chunked (into memory, will be
         however only 1 request)
        :param bool convert_to_pdf: will try to download the converted pdf
         if file extension in ALLOWED_PDF_EXTENSIONS
        :return: Success / Failure
        :rtype: bool

def download(self, to_path=None, name=None, chunk_size='auto',
                 convert_to_pdf=False):
        """ Downloads this file to the local drive. Can download the
        file in chunks with multiple requests to the server.

        :param to_path: a path to store the downloaded file
        :type to_path: str or Path
        :param str name: the name you want the stored file to have.
        :param int chunk_size: number of bytes to retrieve from
         each api call to the server. if auto, files bigger than
         SIZE_THERSHOLD will be chunked (into memory, will be
         however only 1 request)
        :param bool convert_to_pdf: will try to download the converted pdf
         if file extension in ALLOWED_PDF_EXTENSIONS
        :return: Success / Failure
        :rtype: bool
        """
        # TODO: Add download with more than one request (chunk_requests) with
        # header 'Range'. For example: 'Range': 'bytes=0-1024'

        if to_path is None:
            to_path = Path()
        else:
            if not isinstance(to_path, Path):
                to_path = Path(to_path)

        if not to_path.exists():
            raise FileNotFoundError('{} does not exist'.format(to_path))

        if name and not Path(name).suffix and self.name:
            name = name + Path(self.name).suffix

        name = name or self.name
        to_path = to_path / name

        url = self.build_url(
            self._endpoints.get('download').format(id=self.object_id))

        try:
            if chunk_size is None:
                stream = False
            elif chunk_size == 'auto':
                if self.size and self.size > SIZE_THERSHOLD:
                    stream = True
                else:
                    stream = False
            elif isinstance(chunk_size, int):
                stream = True
            else:
                raise ValueError("Argument chunk_size must be either 'auto' "
                                 "or any integer number representing bytes")

            params = {}
            if convert_to_pdf and Path(name).suffix in ALLOWED_PDF_EXTENSIONS:
                params['format'] = 'pdf'

            with self.con.get(url, stream=stream, params=params) as response:
                if not response:
                    log.debug('Downloading driveitem Request failed: {}'.format(
                        response.reason))
                    return False
                with to_path.open(mode='wb') as output:
                    if stream:
                        for chunk in response.iter_content(
                                chunk_size=chunk_size):
                            if chunk:
                                output.write(chunk)
                    else:
                        output.write(response.content)
        except Exception as e:
            log.error(
                'Error downloading driveitem {}. Error: {}'.format(self.name,
                                                                   str(e)))
            return False

        return True