python-hwpx 6.10.0__py3-none-any.whl → 6.12.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hwpx/_document/_legacy.py +2 -2
- hwpx/_document/fields.py +26 -2
- hwpx/_document/headings.py +5 -7
- hwpx/_document/layout.py +43 -3
- hwpx/_document/ns/fields.py +1 -1
- hwpx/_document/ns/tables.py +7 -1
- hwpx/_document/ns/text.py +79 -0
- hwpx/_document/persistence.py +20 -0
- hwpx/_document/text_blocks.py +385 -0
- hwpx/_trailing_table_text.py +85 -0
- hwpx/body_patch.py +172 -32
- hwpx/capabilities.py +46 -9
- hwpx/data/contract_docs/mutation-semantics.md +6 -3
- hwpx/data/contract_docs/support-matrix.md +11 -7
- hwpx/document.py +49 -12
- hwpx/equation/authoring.py +5 -3
- hwpx/equation/eqedit.py +22 -6
- hwpx/equation/mathml.py +24 -2
- hwpx/equation/measure.py +10 -4
- hwpx/errors.py +20 -3
- hwpx/form_fit/_glyph_table.json.gz +0 -0
- hwpx/form_fit/_glyph_table.py +54 -8958
- hwpx/form_fit/measure.py +269 -41
- hwpx/hwp5/package.py +31 -2
- hwpx/hwp5/summary.py +27 -2
- hwpx/ingest/base.py +7 -1
- hwpx/ingest/hwpx_converter.py +153 -2
- hwpx/layout/_page_measure.py +3009 -0
- hwpx/layout/line_cache.py +50 -9
- hwpx/layout/pages.py +268 -2650
- hwpx/objects/checkbox.py +1 -1
- hwpx/opc/package.py +110 -32
- hwpx/opc/xml_utils.py +19 -1
- hwpx/oxml/_document_primitives.py +29 -19
- hwpx/oxml/_paragraph_text_edit.py +51 -1
- hwpx/oxml/document_parts.py +3 -1
- hwpx/oxml/drop_cap.py +11 -1
- hwpx/oxml/header_part.py +51 -18
- hwpx/oxml/paragraph.py +35 -1
- hwpx/oxml/run.py +13 -1
- hwpx/oxml/section.py +161 -8
- hwpx/oxml/simple_parts.py +23 -1
- hwpx/oxml/table.py +67 -11
- hwpx/oxml/table_merge.py +85 -1
- hwpx/oxml/table_sizes.py +37 -0
- hwpx/oxml/table_structure.py +60 -6
- hwpx/patch.py +77 -9
- hwpx/table_patch.py +511 -137
- hwpx/templates.py +66 -0
- hwpx/tools/archive_cli.py +6 -13
- hwpx/tools/doc_diff.py +15 -2
- hwpx/tools/document_viewer.py +2 -2
- hwpx/tools/exporter.py +34 -3
- hwpx/tools/format_rules.py +530 -0
- hwpx/tools/layout_preview.py +60 -5
- hwpx/tools/mail_merge.py +24 -1
- hwpx/tools/markdown_export.py +79 -11
- hwpx/tools/markdown_import.py +473 -0
- hwpx/tools/object_finder.py +3 -2
- hwpx/tools/package_validator.py +59 -8
- hwpx/tools/recover.py +5 -1
- hwpx/tools/repair.py +9 -12
- hwpx/tools/table_navigation.py +53 -36
- hwpx/tools/text_extractor.py +44 -1
- hwpx/tools/toc_fidelity.py +4 -1
- {python_hwpx-6.10.0.dist-info → python_hwpx-6.12.0.dist-info}/METADATA +16 -3
- {python_hwpx-6.10.0.dist-info → python_hwpx-6.12.0.dist-info}/RECORD +72 -66
- {python_hwpx-6.10.0.dist-info → python_hwpx-6.12.0.dist-info}/entry_points.txt +1 -0
- {python_hwpx-6.10.0.dist-info → python_hwpx-6.12.0.dist-info}/WHEEL +0 -0
- {python_hwpx-6.10.0.dist-info → python_hwpx-6.12.0.dist-info}/licenses/LICENSE +0 -0
- {python_hwpx-6.10.0.dist-info → python_hwpx-6.12.0.dist-info}/licenses/NOTICE +0 -0
- {python_hwpx-6.10.0.dist-info → python_hwpx-6.12.0.dist-info}/top_level.txt +0 -0
hwpx/_document/_legacy.py
CHANGED
|
@@ -1361,7 +1361,7 @@ class _LegacyFacade:
|
|
|
1361
1361
|
break
|
|
1362
1362
|
return replacements
|
|
1363
1363
|
|
|
1364
|
-
@_moved("doc.fields.
|
|
1364
|
+
@_moved("doc.fields.set_check_box")
|
|
1365
1365
|
def set_check_box(
|
|
1366
1366
|
self,
|
|
1367
1367
|
checked: bool,
|
|
@@ -1721,7 +1721,7 @@ class _LegacyFacade:
|
|
|
1721
1721
|
border_width=border_width,
|
|
1722
1722
|
)
|
|
1723
1723
|
|
|
1724
|
-
@_moved("doc.styles.
|
|
1724
|
+
@_moved("doc.styles.get")
|
|
1725
1725
|
def style(self, style_id_ref: int | str | None) -> Style | None:
|
|
1726
1726
|
"""Return the style definition referenced by *style_id_ref*."""
|
|
1727
1727
|
|
hwpx/_document/fields.py
CHANGED
|
@@ -440,6 +440,14 @@ def _iter_form_field_matches(doc: "HwpxDocument") -> list[dict[str, Any]]:
|
|
|
440
440
|
|
|
441
441
|
|
|
442
442
|
def _iter_field_matches(doc: "HwpxDocument", accept: Any) -> list[dict[str, Any]]:
|
|
443
|
+
return _field_matches_in(doc, accept, _iter_content_paragraphs(doc))
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
def _field_matches_in(
|
|
447
|
+
doc: "HwpxDocument",
|
|
448
|
+
accept: Any,
|
|
449
|
+
paragraphs: Iterator[tuple[int, int, int, Any, HwpxOxmlParagraph, list[Any]]],
|
|
450
|
+
) -> list[dict[str, Any]]:
|
|
443
451
|
"""The fields whose ``<hp:fieldBegin>`` *accept(ctrl, field_begin)* takes, in
|
|
444
452
|
document order, with their text up to the matching ``<hp:fieldEnd>``."""
|
|
445
453
|
|
|
@@ -451,7 +459,7 @@ def _iter_field_matches(doc: "HwpxDocument", accept: Any) -> list[dict[str, Any]
|
|
|
451
459
|
paragraph_element,
|
|
452
460
|
paragraph,
|
|
453
461
|
runs,
|
|
454
|
-
) in
|
|
462
|
+
) in paragraphs:
|
|
455
463
|
for run_index, run in enumerate(runs):
|
|
456
464
|
children = list(run)
|
|
457
465
|
for child_index, child in enumerate(children):
|
|
@@ -526,6 +534,22 @@ def _iter_field_matches(doc: "HwpxDocument", accept: Any) -> list[dict[str, Any]
|
|
|
526
534
|
return matches
|
|
527
535
|
|
|
528
536
|
|
|
537
|
+
def _refresh_form_field_match(doc: "HwpxDocument", match: Mapping[str, Any]) -> dict[str, Any]:
|
|
538
|
+
"""Re-read the selected field after filling it, without rebuilding unrelated payloads.
|
|
539
|
+
|
|
540
|
+
Filling can remove nested fields or following paragraphs, but retains the selected begin and everything
|
|
541
|
+
before it. Its paragraph location and field index therefore stay valid. Read its runs and matching end
|
|
542
|
+
afresh: inserting text or collapsing a span can change their indices and the result's style snapshot.
|
|
543
|
+
"""
|
|
544
|
+
|
|
545
|
+
paragraph = match["_paragraph"]
|
|
546
|
+
source = (match["section_index"], match["paragraph_index"], match["paragraph_index_in_section"],
|
|
547
|
+
paragraph.element, paragraph, [child for child in paragraph.element if _local_name(child) == "run"])
|
|
548
|
+
refreshed = _field_matches_in(doc, lambda ctrl, begin: begin is match["_field_begin"], iter((source,)))[0]
|
|
549
|
+
refreshed["index"] = match["index"]
|
|
550
|
+
return refreshed
|
|
551
|
+
|
|
552
|
+
|
|
529
553
|
def _form_field_from_match(doc: "HwpxDocument", match: Mapping[str, Any]) -> FormField:
|
|
530
554
|
"""Build the public :class:`FormField` view from an internal match payload.
|
|
531
555
|
|
|
@@ -1230,7 +1254,7 @@ def fill_form_field(
|
|
|
1230
1254
|
|
|
1231
1255
|
_clear_form_field_layout_cache(paragraph.element)
|
|
1232
1256
|
paragraph.section.mark_dirty()
|
|
1233
|
-
updated =
|
|
1257
|
+
updated = _refresh_form_field_match(doc, match)
|
|
1234
1258
|
after_style = _field_run_style_snapshot(
|
|
1235
1259
|
doc,
|
|
1236
1260
|
updated["_runs"],
|
hwpx/_document/headings.py
CHANGED
|
@@ -170,13 +170,11 @@ def bind_outline_level(
|
|
|
170
170
|
from . import layout as _layout
|
|
171
171
|
|
|
172
172
|
_check_level(level)
|
|
173
|
-
target
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
)
|
|
179
|
-
return
|
|
173
|
+
# The paragraph itself is the target: looking its index up in the list of every body paragraph,
|
|
174
|
+
# and resolving that index back, made a run of headings quadratic.
|
|
175
|
+
if _layout._body_indexes(document, [paragraph])[0] is not None:
|
|
176
|
+
_layout.set_paragraph_format(document, paragraphs=[paragraph], outline_level=level)
|
|
177
|
+
return
|
|
180
178
|
# 방금 만든 문단이라 항상 찾힌다. 못 찾으면 조용히 넘어가는 대신 말한다 —
|
|
181
179
|
# 개요 수준이 빠진 문단은 "번호가 안 붙는 제목"이라 무음 실패가 가장 나쁘다.
|
|
182
180
|
raise HwpxLookupError( # pragma: no cover - 방어
|
hwpx/_document/layout.py
CHANGED
|
@@ -232,6 +232,48 @@ def _resolve_paragraph_objects(
|
|
|
232
232
|
return resolved
|
|
233
233
|
|
|
234
234
|
|
|
235
|
+
def _body_indexes(
|
|
236
|
+
doc: "HwpxDocument", objects: Sequence[HwpxOxmlParagraph]
|
|
237
|
+
) -> list[int | None]:
|
|
238
|
+
"""Where each paragraph object sits in ``doc.paragraphs``; ``None`` for one outside the body.
|
|
239
|
+
|
|
240
|
+
A few objects are placed by counting the paragraphs before them in their section, which reads
|
|
241
|
+
no other paragraph; wrapping every body paragraph to place one made a run of single-paragraph
|
|
242
|
+
calls (a heading per call) quadratic. Many objects, or plain ElementTree elements, go through
|
|
243
|
+
the list of body paragraphs once.
|
|
244
|
+
"""
|
|
245
|
+
|
|
246
|
+
elements: list[Any] = [paragraph.element for paragraph in objects]
|
|
247
|
+
if len(elements) > 8 or not all(hasattr(element, "itersiblings") for element in elements):
|
|
248
|
+
body_index = {paragraph.element: index for index, paragraph in enumerate(doc.paragraphs)}
|
|
249
|
+
return [body_index.get(element) for element in elements]
|
|
250
|
+
|
|
251
|
+
section_roots: list[Any] = [section.element for section in doc.sections]
|
|
252
|
+
starts: list[int] = [] # body index of each section's first paragraph, filled as far as needed
|
|
253
|
+
|
|
254
|
+
def start_of(section_position: int) -> int:
|
|
255
|
+
while len(starts) <= section_position:
|
|
256
|
+
previous = len(starts) - 1
|
|
257
|
+
starts.append(
|
|
258
|
+
0 if previous < 0
|
|
259
|
+
else starts[previous] + sum(1 for _ in section_roots[previous].iterchildren("{*}p"))
|
|
260
|
+
)
|
|
261
|
+
return starts[section_position]
|
|
262
|
+
|
|
263
|
+
indexes: list[int | None] = []
|
|
264
|
+
for element in elements:
|
|
265
|
+
parent = element.getparent()
|
|
266
|
+
position = next(
|
|
267
|
+
(index for index, root in enumerate(section_roots) if root is parent), None
|
|
268
|
+
)
|
|
269
|
+
if position is None or not isinstance(element.tag, str) or element.tag.rsplit("}", 1)[-1] != "p":
|
|
270
|
+
indexes.append(None)
|
|
271
|
+
continue
|
|
272
|
+
before = sum(1 for _ in element.itersiblings("{*}p", preceding=True))
|
|
273
|
+
indexes.append(start_of(position) + before)
|
|
274
|
+
return indexes
|
|
275
|
+
|
|
276
|
+
|
|
235
277
|
def set_paragraph_format(
|
|
236
278
|
doc: "HwpxDocument",
|
|
237
279
|
*,
|
|
@@ -376,9 +418,7 @@ def set_paragraph_format(
|
|
|
376
418
|
suggestion="Pass only one.",
|
|
377
419
|
)
|
|
378
420
|
objects = _resolve_paragraph_objects(doc, paragraphs)
|
|
379
|
-
|
|
380
|
-
body_index = {paragraph.element: index for index, paragraph in enumerate(body)}
|
|
381
|
-
targets = [(body_index.get(paragraph.element), paragraph) for paragraph in objects]
|
|
421
|
+
targets = list(zip(_body_indexes(doc, objects), objects))
|
|
382
422
|
else:
|
|
383
423
|
targets = list(_resolve_paragraph_targets(doc,
|
|
384
424
|
paragraph_index=paragraph_index,
|
hwpx/_document/ns/fields.py
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
id 별칭은 `field_id` 하나로, 위치 5키는 `location` 하나로 접혔다.
|
|
16
16
|
|
|
17
17
|
`CheckBox.checked` 가 쓰기 가능한 속성이므로 `set_check_box` 는 사실상
|
|
18
|
-
`doc.fields.
|
|
18
|
+
`doc.fields.check_boxes[i].checked = False` 로 대체된다. 5.x 이름은 shim 으로
|
|
19
19
|
살아 있고, 이 네임스페이스에도 같은 이름을 남겨 이주 중 양쪽이 겹치게 했다.
|
|
20
20
|
"""
|
|
21
21
|
|
hwpx/_document/ns/tables.py
CHANGED
|
@@ -35,7 +35,13 @@ class TablesNamespace(_Namespace):
|
|
|
35
35
|
|
|
36
36
|
@property
|
|
37
37
|
def all(self) -> list["Table"]:
|
|
38
|
-
"""
|
|
38
|
+
"""본문 문단에 바로 놓인 표를 문서 순서로.
|
|
39
|
+
|
|
40
|
+
표 칸 안의 표, 머리말·꼬리말·각주·미주·글상자 안의 표는 들어 있지 않다.
|
|
41
|
+
칸 안의 표는 그 칸에서(``cell.tables``), 글까지 모두
|
|
42
|
+
훑으려면 ``doc.text.blocks()``를 쓴다. ``len(doc.tables)``와
|
|
43
|
+
``for table in doc.tables``도 같은 범위다.
|
|
44
|
+
"""
|
|
39
45
|
|
|
40
46
|
tables: list["Table"] = []
|
|
41
47
|
for paragraph in self._doc.paragraphs:
|
hwpx/_document/ns/text.py
CHANGED
|
@@ -20,7 +20,9 @@ from ._base import _Namespace
|
|
|
20
20
|
|
|
21
21
|
if TYPE_CHECKING:
|
|
22
22
|
from ...objects.highlight import Highlight
|
|
23
|
+
from ...tools.markdown_import import MarkdownStyle
|
|
23
24
|
from ...oxml import HwpxOxmlParagraph, HwpxOxmlRun
|
|
25
|
+
from ..text_blocks import TextBlock, TextChangeReport, TextOutline
|
|
24
26
|
|
|
25
27
|
__all__ = ["TextNamespace"]
|
|
26
28
|
|
|
@@ -122,6 +124,22 @@ class TextNamespace(_Namespace):
|
|
|
122
124
|
|
|
123
125
|
return _persistence.export_html(self._doc, **kwargs)
|
|
124
126
|
|
|
127
|
+
# -- 가져오기 ----------------------------------------------------------
|
|
128
|
+
|
|
129
|
+
def append_markdown(self, markdown: str, *, style: "MarkdownStyle | None" = None) -> None:
|
|
130
|
+
"""*markdown* 을 마지막 구역 끝에 문단·목록·표로 덧붙인다.
|
|
131
|
+
|
|
132
|
+
``hwpx.tools.markdown_import.from_markdown`` 과 같은 부분 집합(제목 ``#``~``####``,
|
|
133
|
+
문단, ``-``/``1.`` 목록, ``|`` 표, ``**굵게**``/``*기울임*``)을 쓴다.
|
|
134
|
+
새 문단은 앞 문단의 서식을 물려받지 않는다. 모르는 Markdown 은 평문으로
|
|
135
|
+
쓰고 오류를 내지 않는다. *style* 은
|
|
136
|
+
:class:`hwpx.tools.markdown_import.MarkdownStyle`.
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
from ...tools.markdown_import import append_markdown
|
|
140
|
+
|
|
141
|
+
append_markdown(self._doc, markdown, style=style)
|
|
142
|
+
|
|
125
143
|
# -- 순회·검색 ---------------------------------------------------------
|
|
126
144
|
|
|
127
145
|
def runs(self) -> Iterator["HwpxOxmlRun"]:
|
|
@@ -154,6 +172,67 @@ class TextNamespace(_Namespace):
|
|
|
154
172
|
)
|
|
155
173
|
]
|
|
156
174
|
|
|
175
|
+
# -- id 붙은 글 덩어리 ---------------------------------------------------
|
|
176
|
+
|
|
177
|
+
def blocks(self) -> Iterator["TextBlock"]:
|
|
178
|
+
"""본문 문단과 표 칸 문단(칸 안 표 포함)을 문서 순서대로, 안정적인 id와 함께 내놓는다.
|
|
179
|
+
|
|
180
|
+
id는 위치로 정해진다: ``s0p16`` (0번 구역의 16번 본문 문단, 번호는 0부터), ``s0p16t0r3c0q0`` (그 문단의 0번 표,
|
|
181
|
+
3행 0열 칸의 0번 문단), 칸 안 표는 ``…q0t0r1c1q0`` 처럼 이어진다. 행·열은 칸의 주소라
|
|
182
|
+
병합 칸은 대표 칸에서 한 번만 나온다. 저장·재열기 뒤에도 같고, 앞쪽에 문단·표·칸을
|
|
183
|
+
넣거나 지울 때만 바뀐다. 머리말·꼬리말·각주·메모·글상자는 포함하지 않는다.
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
from ..text_blocks import iter_text_blocks
|
|
187
|
+
|
|
188
|
+
return iter_text_blocks(self._doc)
|
|
189
|
+
|
|
190
|
+
def outline(
|
|
191
|
+
self,
|
|
192
|
+
*,
|
|
193
|
+
max_chars: int = 8000,
|
|
194
|
+
max_items: int | None = None,
|
|
195
|
+
max_block_chars: int = 200,
|
|
196
|
+
after: str | None = None,
|
|
197
|
+
) -> "TextOutline":
|
|
198
|
+
"""글자가 있는 덩어리를 ``{"id", "where", "text"}`` 목록으로, 글자 예산 안에서 돌려준다.
|
|
199
|
+
|
|
200
|
+
빈 문단은 빼고, 탭·줄 바꿈은 공백으로, 제어 문자는 지운다. *max_block_chars* 보다 긴
|
|
201
|
+
덩어리는 앞부분만 남기고 ``…`` 로 끝낸다(``"truncated": True``). *max_chars* 는 각 항목의
|
|
202
|
+
id·위치·글자를 센다. 예산이나 *max_items* 가 다하면 항목 단위로 멈추고 ``complete`` 가
|
|
203
|
+
``False``, ``next_after`` 가 마지막 id다 — 다음 쪽은 ``after=next_after`` 로 읽는다. 한 쪽에는 예산보다 큰 항목이라도 적어도 하나가 들어간다.
|
|
204
|
+
``to_text()`` 는 한 줄에 한 항목인 가장 짧은 프롬프트 형태다.
|
|
205
|
+
"""
|
|
206
|
+
|
|
207
|
+
from ..text_blocks import outline
|
|
208
|
+
|
|
209
|
+
return outline(
|
|
210
|
+
self._doc,
|
|
211
|
+
max_chars=max_chars,
|
|
212
|
+
max_items=max_items,
|
|
213
|
+
max_block_chars=max_block_chars,
|
|
214
|
+
after=after,
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
def apply_changes(
|
|
218
|
+
self,
|
|
219
|
+
changes: "dict[str, str]",
|
|
220
|
+
*,
|
|
221
|
+
check_overflow: bool = True,
|
|
222
|
+
) -> "TextChangeReport":
|
|
223
|
+
"""``{id: 새 글}`` 을 한 번에 적용하고 id마다 결과를 보고한다.
|
|
224
|
+
|
|
225
|
+
모든 id를 먼저 찾은 뒤 쓴다. 없는 id는 ``unknown_ids`` 로 보고하고 나머지는 적용한다.
|
|
226
|
+
한 런 안에서 끝나는 바꿈은 런과 컨트롤을 모두 지키고, 서식이 다른 런에 걸치거나 탭·줄
|
|
227
|
+
바꿈을 넣는 바꿈은 문단 첫 런의 서식으로 쓴다(``rewritten``). *check_overflow* 면 바뀐 칸을
|
|
228
|
+
전후로 재어, 칸이 품는 줄보다 많이(그리고 전보다 많이) 필요할 것으로 추정되는 칸을
|
|
229
|
+
``overflow`` 에 넣는다 — 렌더가 아니라 form-fit 측정기의 추정이다.
|
|
230
|
+
"""
|
|
231
|
+
|
|
232
|
+
from ..text_blocks import apply_text_changes
|
|
233
|
+
|
|
234
|
+
return apply_text_changes(self._doc, changes, check_overflow=check_overflow)
|
|
235
|
+
|
|
157
236
|
# -- 치환 --------------------------------------------------------------
|
|
158
237
|
|
|
159
238
|
def replace(
|
hwpx/_document/persistence.py
CHANGED
|
@@ -435,6 +435,7 @@ def save_report(
|
|
|
435
435
|
before=before,
|
|
436
436
|
edit_mask=edit_mask,
|
|
437
437
|
ledger=ledger,
|
|
438
|
+
open_safety=_serialize_open_safety(doc, archive_bytes),
|
|
438
439
|
reference_document=doc,
|
|
439
440
|
source_label="document.save_report",
|
|
440
441
|
)
|
|
@@ -475,6 +476,25 @@ def to_bytes(
|
|
|
475
476
|
return data
|
|
476
477
|
|
|
477
478
|
|
|
479
|
+
def _serialize_open_safety(doc: "HwpxDocument", archive_bytes: bytes) -> OpenSafetyReport | None:
|
|
480
|
+
"""The open-safety verdict the package's save reached for exactly *archive_bytes*, in the form
|
|
481
|
+
the SavePipeline composes from its own run; ``None`` when the package did not validate these
|
|
482
|
+
bytes (the pipeline then validates them itself).
|
|
483
|
+
|
|
484
|
+
The same validation of the same bytes gives the same report, so ``save_report`` hands the
|
|
485
|
+
pipeline this one instead of running it a second time.
|
|
486
|
+
"""
|
|
487
|
+
|
|
488
|
+
package = doc._package
|
|
489
|
+
report = getattr(package, "_verified_archive_report", None)
|
|
490
|
+
digest = getattr(package, "_verified_archive_digest", None)
|
|
491
|
+
if report is None or digest is None or not report.ok:
|
|
492
|
+
return None
|
|
493
|
+
if digest != hashlib.sha256(archive_bytes).digest():
|
|
494
|
+
return None
|
|
495
|
+
return OpenSafetyReport(ok=report.ok, summary=report.summary, detail=report.to_dict())
|
|
496
|
+
|
|
497
|
+
|
|
478
498
|
def _to_bytes_raw(
|
|
479
499
|
doc: "HwpxDocument",
|
|
480
500
|
*,
|