def _page_document(self, elements: List) -> List[Document]:
        """
        Combines elements with the same page number into a single Document object.

        Args:
            elements (List): A list of elements containing page numbers.

        Returns:
            List[Document]: A list of Document objects, each representing a page
                            with its content and metadata.

        """
        _docs = []
        pages = sorted({x["page"] for x in elements})

        page_group = [
            [element for element in elements if element["page"] == x] for x in pages
        ]

        for group in page_group:
            page_content = " ".join(
                [parse_output(element, self.output_format) for element in group]
            )

            coordinates = [
                element.get("coordinates")
                for element in group
                if element.get("coordinates") is not None
            ]

            base64_encodings = [
                element.get("base64_encoding")
                for element in group
                if element.get("base64_encoding") is not None
            ]
            extra_info = {
                "page": group[0]["page"],
                "output_format": self.output_format,
                "split": self.split,
            }

            if coordinates:
                extra_info["coordinates"] = coordinates

            if base64_encodings:
                extra_info["base64_encodings"] = base64_encodings

            _docs.append(
                Document(
                    text=page_content.strip(),
                    extra_info=extra_info,
                )
            )

        return _docs

        Combines elements with the same page number into a single Document object.

        Args:
            elements (List): A list of elements containing page numbers.

        Returns:
            List[Document]: A list of Document objects, each representing a page
                            with its content and metadata.

        
llama-index-integrations/readers/llama-index-readers-upstage/llama_index/readers/upstage/document_parse.py