Skip to content

Commit 1ed2e38

Browse files
committed
Move _text_extractor into _text_extraction
1 parent f4e9285 commit 1ed2e38

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

pypdf/_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
from ._text_extraction import (
5757
_layout_mode,
5858
)
59-
from ._text_extractor import TextExtraction
59+
from ._text_extraction._text_extractor import TextExtraction
6060
from ._utils import (
6161
CompressedTransformationMatrix,
6262
TransformationMatrixType,

pypdf/_text_extractor.py renamed to pypdf/_text_extraction/_text_extractor.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,30 @@
3030
import math
3131
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast
3232

33-
from ._cmap import (
33+
from .._cmap import (
3434
build_char_map,
3535
build_font_width_map,
3636
compute_font_width,
3737
get_actual_str_key,
3838
unknown_char_map,
3939
)
40-
from ._text_extraction import (
41-
OrientationNotFoundError,
42-
crlf_space_check,
43-
get_display_str,
44-
get_text_operands,
45-
mult,
46-
)
47-
from ._utils import logger_warning
48-
from .constants import PageAttributes as PG
49-
from .generic import (
40+
from .._utils import logger_warning
41+
from ..constants import PageAttributes as PG
42+
from ..generic import (
5043
ContentStream,
5144
DictionaryObject,
5245
FloatObject,
5346
NameObject,
5447
NumberObject,
5548
TextStringObject,
5649
)
50+
from . import (
51+
OrientationNotFoundError,
52+
crlf_space_check,
53+
get_display_str,
54+
get_text_operands,
55+
mult,
56+
)
5757

5858

5959
class TextExtraction:
@@ -511,7 +511,10 @@ def _handle_tj(
511511
)
512512

513513
font_widths, actual_str_size["space_width"], actual_str_size["str_height"] = self._get_actual_font_widths(
514-
cmap, text_operands, font_size, space_width,
514+
cmap,
515+
text_operands,
516+
font_size,
517+
space_width,
515518
)
516519
actual_str_size["str_widths"] += font_widths
517520

0 commit comments

Comments
 (0)