# Path: pdfminer/high_level.py
# def extract_pages(
#     pdf_file: FileOrName,
#     password: str = "",
#     page_numbers: Optional[Container[int]] = None,
#     maxpages: int = 0,
#     caching: bool = True,
#     laparams: Optional[LAParams] = None,
# ) -> Iterator[LTPage]:
#     """Extract and yield LTPage objects
# 
#     :param pdf_file: Either a file path or a file-like object for the PDF file
#         to be worked on.
#     :param password: For encrypted PDFs, the password to decrypt.
#     :param page_numbers: List of zero-indexed page numbers to extract.
#     :param maxpages: The maximum number of pages to parse
#     :param caching: If resources should be cached
#     :param laparams: An LAParams object from pdfminer.layout. If None, uses
#         some default settings that often work well.
#     :return:
#     """
#     if laparams is None:
#         laparams = LAParams()
# 
#     with open_filename(pdf_file, "rb") as fp:
#         fp = cast(BinaryIO, fp)  # we opened in binary mode
#         resource_manager = PDFResourceManager(caching=caching)
#         device = PDFPageAggregator(resource_manager, laparams=laparams)
#         interpreter = PDFPageInterpreter(resource_manager, device)
#         for page in PDFPage.get_pages(
#             fp, page_numbers, maxpages=maxpages, password=password, caching=caching
#         ):
#             interpreter.process_page(page)
#             layout = device.get_result()
#             yield layout
# 
# Path: pdfminer/layout.py
# class LTChar(LTComponent, LTText):
#     """Actual letter in the text as a Unicode string."""
# 
#     def __init__(
#         self,
#         matrix: Matrix,
#         font: PDFFont,
#         fontsize: float,
#         scaling: float,
#         rise: float,
#         text: str,
#         textwidth: float,
#         textdisp: Union[float, Tuple[Optional[float], float]],
#         ncs: PDFColorSpace,
#         graphicstate: PDFGraphicState,
#     ) -> None:
#         LTText.__init__(self)
#         self._text = text
#         self.matrix = matrix
#         self.fontname = font.fontname
#         self.ncs = ncs
#         self.graphicstate = graphicstate
#         self.adv = textwidth * fontsize * scaling
#         # compute the boundary rectangle.
#         if font.is_vertical():
#             # vertical
#             assert isinstance(textdisp, tuple)
#             (vx, vy) = textdisp
#             if vx is None:
#                 vx = fontsize * 0.5
#             else:
#                 vx = vx * fontsize * 0.001
#             vy = (1000 - vy) * fontsize * 0.001
#             bbox_lower_left = (-vx, vy + rise + self.adv)
#             bbox_upper_right = (-vx + fontsize, vy + rise)
#         else:
#             # horizontal
#             descent = font.get_descent() * fontsize
#             bbox_lower_left = (0, descent + rise)
#             bbox_upper_right = (self.adv, descent + rise + fontsize)
#         (a, b, c, d, e, f) = self.matrix
#         self.upright = 0 < a * d * scaling and b * c <= 0
#         (x0, y0) = apply_matrix_pt(self.matrix, bbox_lower_left)
#         (x1, y1) = apply_matrix_pt(self.matrix, bbox_upper_right)
#         if x1 < x0:
#             (x0, x1) = (x1, x0)
#         if y1 < y0:
#             (y0, y1) = (y1, y0)
#         LTComponent.__init__(self, (x0, y0, x1, y1))
#         if font.is_vertical():
#             self.size = self.width
#         else:
#             self.size = self.height
#         return
# 
#     def __repr__(self) -> str:
#         return "<%s %s matrix=%s font=%r adv=%s text=%r>" % (
#             self.__class__.__name__,
#             bbox2str(self.bbox),
#             matrix2str(self.matrix),
#             self.fontname,
#             self.adv,
#             self.get_text(),
#         )
# 
#     def get_text(self) -> str:
#         return self._text
# 
#     def is_compatible(self, obj: object) -> bool:
#         """Returns True if two characters can coexist in the same line."""
#         return True
# 
# class LTTextBox(LTTextContainer[LTTextLine]):
#     """Represents a group of text chunks in a rectangular area.
# 
#     Note that this box is created by geometric analysis and does not
#     necessarily represents a logical boundary of the text. It contains a list
#     of LTTextLine objects.
#     """
# 
#     def __init__(self) -> None:
#         LTTextContainer.__init__(self)
#         self.index: int = -1
#         return
# 
#     def __repr__(self) -> str:
#         return "<%s(%s) %s %r>" % (
#             self.__class__.__name__,
#             self.index,
#             bbox2str(self.bbox),
#             self.get_text(),
#         )
# 
#     def get_writing_mode(self) -> str:
#         raise NotImplementedError


from helpers import absolute_sample_path
from pdfminer.high_level import extract_pages
from pdfminer.layout import LTChar, LTTextBox


def test_font_size():
    path = absolute_sample_path("font-size-test.pdf")
    for page in extract_pages(path):
        for text_box in page:

# Path: pdfminer/high_level.py
# def extract_pages(
#     pdf_file: FileOrName,
#     password: str = "",
#     page_numbers: Optional[Container[int]] = None,
#     maxpages: int = 0,
#     caching: bool = True,
#     laparams: Optional[LAParams] = None,
# ) -> Iterator[LTPage]:
#     """Extract and yield LTPage objects
# 
#     :param pdf_file: Either a file path or a file-like object for the PDF file
#         to be worked on.
#     :param password: For encrypted PDFs, the password to decrypt.
#     :param page_numbers: List of zero-indexed page numbers to extract.
#     :param maxpages: The maximum number of pages to parse
#     :param caching: If resources should be cached
#     :param laparams: An LAParams object from pdfminer.layout. If None, uses
#         some default settings that often work well.
#     :return:
#     """
#     if laparams is None:
#         laparams = LAParams()
# 
#     with open_filename(pdf_file, "rb") as fp:
#         fp = cast(BinaryIO, fp)  # we opened in binary mode
#         resource_manager = PDFResourceManager(caching=caching)
#         device = PDFPageAggregator(resource_manager, laparams=laparams)
#         interpreter = PDFPageInterpreter(resource_manager, device)
#         for page in PDFPage.get_pages(
#             fp, page_numbers, maxpages=maxpages, password=password, caching=caching
#         ):
#             interpreter.process_page(page)
#             layout = device.get_result()
#             yield layout
# 
# Path: pdfminer/layout.py
# class LTChar(LTComponent, LTText):
#     """Actual letter in the text as a Unicode string."""
# 
#     def __init__(
#         self,
#         matrix: Matrix,
#         font: PDFFont,
#         fontsize: float,
#         scaling: float,
#         rise: float,
#         text: str,
#         textwidth: float,
#         textdisp: Union[float, Tuple[Optional[float], float]],
#         ncs: PDFColorSpace,
#         graphicstate: PDFGraphicState,
#     ) -> None:
#         LTText.__init__(self)
#         self._text = text
#         self.matrix = matrix
#         self.fontname = font.fontname
#         self.ncs = ncs
#         self.graphicstate = graphicstate
#         self.adv = textwidth * fontsize * scaling
#         # compute the boundary rectangle.
#         if font.is_vertical():
#             # vertical
#             assert isinstance(textdisp, tuple)
#             (vx, vy) = textdisp
#             if vx is None:
#                 vx = fontsize * 0.5
#             else:
#                 vx = vx * fontsize * 0.001
#             vy = (1000 - vy) * fontsize * 0.001
#             bbox_lower_left = (-vx, vy + rise + self.adv)
#             bbox_upper_right = (-vx + fontsize, vy + rise)
#         else:
#             # horizontal
#             descent = font.get_descent() * fontsize
#             bbox_lower_left = (0, descent + rise)
#             bbox_upper_right = (self.adv, descent + rise + fontsize)
#         (a, b, c, d, e, f) = self.matrix
#         self.upright = 0 < a * d * scaling and b * c <= 0
#         (x0, y0) = apply_matrix_pt(self.matrix, bbox_lower_left)
#         (x1, y1) = apply_matrix_pt(self.matrix, bbox_upper_right)
#         if x1 < x0:
#             (x0, x1) = (x1, x0)
#         if y1 < y0:
#             (y0, y1) = (y1, y0)
#         LTComponent.__init__(self, (x0, y0, x1, y1))
#         if font.is_vertical():
#             self.size = self.width
#         else:
#             self.size = self.height
#         return
# 
#     def __repr__(self) -> str:
#         return "<%s %s matrix=%s font=%r adv=%s text=%r>" % (
#             self.__class__.__name__,
#             bbox2str(self.bbox),
#             matrix2str(self.matrix),
#             self.fontname,
#             self.adv,
#             self.get_text(),
#         )
# 
#     def get_text(self) -> str:
#         return self._text
# 
#     def is_compatible(self, obj: object) -> bool:
#         """Returns True if two characters can coexist in the same line."""
#         return True
# 
# class LTTextBox(LTTextContainer[LTTextLine]):
#     """Represents a group of text chunks in a rectangular area.
# 
#     Note that this box is created by geometric analysis and does not
#     necessarily represents a logical boundary of the text. It contains a list
#     of LTTextLine objects.
#     """
# 
#     def __init__(self) -> None:
#         LTTextContainer.__init__(self)
#         self.index: int = -1
#         return
# 
#     def __repr__(self) -> str:
#         return "<%s(%s) %s %r>" % (
#             self.__class__.__name__,
#             self.index,
#             bbox2str(self.bbox),
#             self.get_text(),
#         )
# 
#     def get_writing_mode(self) -> str:
#         raise NotImplementedError


# Path: tests/test_font_size.py
from helpers import absolute_sample_path
from pdfminer.high_level import extract_pages
from pdfminer.layout import LTChar, LTTextBox



def test_font_size():
    path = absolute_sample_path("font-size-test.pdf")
    for page in extract_pages(path):
        for text_box in page:

            if isinstance(text_box, LTTextBox):