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

헤더푸터 #41

Closed
scopfield90 opened this issue Mar 25, 2019 · 1 comment
Closed

헤더푸터 #41

scopfield90 opened this issue Mar 25, 2019 · 1 comment

Comments

@scopfield90
Copy link

노고가 많으십니다.

헤더나 푸터에 문단으로 이미지나 텍스트를 쓸 수 있는 방법이 있을까요?

감사합니다.

@neolord0
Copy link
Owner

neolord0 commented Mar 31, 2019

답변이 늦었군요...

hwp에서 헤더(머리말)이나 푸터(꼬리말)을 추가하면, 파일 내부에서 해당 문단에 머리말 컨트롤이나 꼬리말 컨트롤이 생성됩니다.

머리말/컨트롤 컨트롤은 문단 리스트를 포함하고 있는데, 여기에 이미지나 텍스트를 추가하면 가능할 거 같습니다.
아마도 섹션(Section)에 첫 번째 문단(Paragraph)에 컨트롤 리스트에 이 컨트롤들이 있을거라 생각됩니다.

HWPFile hwpFile = HWPReader.fromFile(filename);
if (hwpFile != null) {
Section s = hwpFile.getBodyText().getSectionList().get(0);
Paragraph firstParagraph = s.getParagraph(0);
int headerIndex = 구해야 함...
ControlHeader header = (ControlHeader) firstParagraph.getControlLIst().get(headerIndex);
ParagaphList headerParaList = header.getPararaphList();
}

headerParaList에서 이미지나 텍스트를 가져다 사용할 수 있습니다.
대략 이런 식으로 가능할 것입니다.

설명이 부족한 부분이 있으시면.. 다시 질문해주세요..

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