MCPcopy
hub / github.com/ArtifexSoftware/pdf2docx / __init__

Method __init__

pdf2docx/shape/Shape.py:144–158  ·  view source on GitHub ↗
(self, raw:dict=None)

Source from the content-addressed store, hash-verified

142 The semantic meaning may be table border, or text style line like underline and strike-through.
143 '''
144 def __init__(self, raw:dict=None):
145 raw = raw or {}
146 # NOTE: real page CS
147 self._start = fitz.Point(raw.get('start', (0.0, 0.0)))
148 self._end = fitz.Point(raw.get('end', (0.0, 0.0)))
149
150 if self._start.x > self._end.x or self._start.y > self._end.y:
151 self._start, self._end = self._end, self._start
152
153 # width, color
154 super().__init__(raw) # type, color
155 self.width = raw.get('width', 0.0) # Note this "width" is actually the height of stroke
156
157 # update bbox
158 super().update_bbox(self._to_rect())
159
160
161 @property

Callers

nothing calls this directly

Calls 4

_to_rectMethod · 0.95
getMethod · 0.80
__init__Method · 0.45
update_bboxMethod · 0.45

Tested by

no test coverage detected