hwp->hwpml 변환 시 차트 변환 기능으로 차트 수정 후 파일 저장(팝업 클릭 필요)

This commit is contained in:
2025-01-16 16:25:12 +09:00
parent a9b67411fc
commit ba29501ed6

21
test.py
View File

@@ -67,6 +67,23 @@ def convert_hwp_to_xml(input_folder, output_folder):
# 파일 열기
hwp.Open(str(hwp_file), "HWP")
#hwpactionid 기반
hwp.Run("MoveDocBegin")
hwp.Run("SelectCtrlFront")
while True:
curr = hwp.KeyIndicator()
print(curr[-1])
hwp.Run("SelectCtrlFront")
hwp.SetMessageBoxMode(0x111111)
hwp.Run("VtChartConverter")
next = hwp.KeyIndicator()
if next == curr:
break
hwp.SetMessageBoxMode(0x0000F0) #메시지 박스 원래대로
# XML 파일 경로 설정
xml_filename = hwp_file.stem + ".hml"
xml_path = os.path.join(output_folder, xml_filename)
@@ -113,8 +130,8 @@ if __name__ == "__main__":
# output_folder = r"C:\Users\dra\project\HWP-Scoring\output" # XML 파일을 저장할 폴더
# 변환할 폴더 경로 설정
input_folder = r"C:\Users\gzero-ser7-win11\source\repos\hwpTest\input" # HWP 파일이 있는 폴더
output_folder = r"C:\Users\gzero-ser7-win11\source\repos\hwpTest\output" # XML 파일을 저장할 폴더
input_folder = r"C:\Users\gzero-ser7-win11\Project\KAIT\hwpTest\input" # HWP 파일이 있는 폴더
output_folder = r"C:\Users\gzero-ser7-win11\Project\KAIT\hwpTest\output" # XML 파일을 저장할 폴더
# output_folder = r"\hwp-output" # HWP 파일이 있는 폴더