Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HWP파일 읽고 쓸 때 이미지 깨짐 #127

Closed
seopchan opened this issue Feb 4, 2021 · 1 comment
Closed

HWP파일 읽고 쓸 때 이미지 깨짐 #127

seopchan opened this issue Feb 4, 2021 · 1 comment

Comments

@seopchan
Copy link

seopchan commented Feb 4, 2021

25.hwp.zip
4043.hwp.zip

위 파일들의 numbering을 없애고 번호를 text로 작성을 하는 테스트 중
HWPReader.fromFile()로 파일을 읽고 HWPWriter.toFile()로 파일을 작성하면 한글 파일의 일부 이미지가 깨지는 현상이 있습니다.

테스트에 사용한 코드입니다.

HWPFile hwpFile = HWPReader.fromFile("question/" + fileName);

        ArrayList<Numbering> nl = hwpFile.getDocInfo().getNumberingList();
        for (Numbering n : nl) {
            n.getLevelNumbering(1).setNumberFormat(null);
        }

        Paragraph p = hwpFile.getBodyText().getSectionList().get(0).getParagraph(0);
        p.getText().getCharList().remove(2);

        HWPWriter.toFile(hwpFile, "new" + fileName);

위 코드로 25.hwp, 4043.hwp파일을 테스트 하면 아래와 같은 결과 파일이 나옵니다..
new25.hwp.zip
new4043.hwp.zip

@neolord0
Copy link
Owner

조금 늦었지만.. 수정하였습니다.
생각 했던 거랑 다른 부분에서 오류가 나서 좀 헤맸네요.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants