v5:HWPX 스타일 주입 + 표 열너비 변환_20260127
This commit is contained in:
22
app.py
22
app.py
@@ -229,16 +229,22 @@ def export_hwp():
|
||||
|
||||
# 스타일 그루핑 사용 여부
|
||||
if use_style_grouping:
|
||||
converter.convert_with_styles(html_path, hwp_path)
|
||||
final_path = converter.convert_with_styles(html_path, hwp_path)
|
||||
# HWPX 파일 전송
|
||||
return send_file(
|
||||
final_path,
|
||||
as_attachment=True,
|
||||
download_name=f'report_{datetime.now().strftime("%Y%m%d_%H%M%S")}.hwpx',
|
||||
mimetype='application/vnd.hancom.hwpx'
|
||||
)
|
||||
else:
|
||||
converter.convert(html_path, hwp_path)
|
||||
|
||||
return send_file(
|
||||
hwp_path,
|
||||
as_attachment=True,
|
||||
download_name=f'report_{datetime.now().strftime("%Y%m%d_%H%M%S")}.hwp',
|
||||
mimetype='application/x-hwp'
|
||||
)
|
||||
return send_file(
|
||||
hwp_path,
|
||||
as_attachment=True,
|
||||
download_name=f'report_{datetime.now().strftime("%Y%m%d_%H%M%S")}.hwp',
|
||||
mimetype='application/x-hwp'
|
||||
)
|
||||
|
||||
except ImportError as e:
|
||||
return jsonify({'error': f'pyhwpx 필요: {str(e)}'}), 500
|
||||
|
||||
Reference in New Issue
Block a user