Coder Social home page Coder Social logo

Comments (5)

iu7726 avatar iu7726 commented on August 23, 2024

hwplib문의.zip
테스한 파일입니다.

from hwplib.

neolord0 avatar neolord0 commented on August 23, 2024

네.. 검토해 보겠습니다.

from hwplib.

iu7726 avatar iu7726 commented on August 23, 2024

넵 답변감사합니다!

from hwplib.

neolord0 avatar neolord0 commented on August 23, 2024

한글은 그림을 저장할 때는

  1. 그림의 바이너리 데이터는 hwpFile.getBinData()에 저장하고,
  2. 이 바이너리 데이터에 대한 정보를 공통 영역(DocInfo,getBinDataList())을 객체로 만들어 저장하고
  3. 이 공통 영역의 객체를 그림을 사용한 컨트롤에서 링크합니다.
    iu7726 님이 코드가 1)~2) 까지 되어 있습니다.

iu7726 님이 코드로 나온 그림의 순서는 문서 상에 순서가 아닌 한글 프로그램에서 그림을 삽입한 순서입니다.

문서에서 표시된 순서대로 저장하고 싶으면,

  1. 문서 내용 부분(BodyText)에서 그림을 사용한 컨트롤을 찾아서 그림의 인덱스을 구하고,
  2. DocInfo,getBinDataList()에서 이 인덱스에 해당하는 객체를 찾는
    과정이 필요합니다.

BodyText는 섹션의 리스트이고, 섹션은 문단(Paragraph)의 리스트이며, 문단은 여러개의 컨트롤 포함하고 있습니다. 이렇게 하향 루프를 돌면서, 전체 컨트롤를 조사해서 그림이 사용된 컨트롤을 찾아야 합니다.

이렇게 해도, 예제와 같이 단순한 양식의 문서는 이런 형태로 가능합니다만,
파일 상의 컨트롤의 순서가 문서 상의 순서랑 반대인 경우에는 좀 이상하게 나올 확률이 있습니다.
이 기능을 완벽하게 지원하려면, 한글 뷰어처럼 문서 내의 컨트롤의 위치를 계산해주는 알고리즘이 필요한데, 이 부분은 아직 모르는 부분이라....

일단 위에 방식대로 하면, 어느 정도 iu7726 님이 원하는 기능이 구현될 거라 생각됩니다.

from hwplib.

iu7726 avatar iu7726 commented on August 23, 2024

자세한 답변 감사합니다!

from hwplib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.