Git Product home page Git Product logo

libhwp's Introduction

HWP File Format Library



본 라이브러리는 한글과 컴퓨터의 한글 문서 파일(.hwp) 공개 문서를 참고하여 개발하였습니다.


Features

  • 빈 문서 (Empty Document)
    • 한글 프로그램을 실행시키면 나오는 빈 문서를 제어할 수 있습니다.

kotlin

val hwp: HWPDocument = HWPDocument() // basic constructor makes empty document

// do something...

Java

HWPDocument hwp = new HWPDocument();

// do something

  • 한글문서(HWP) 읽기 (read)

kotlin

val hwpLocal: HWPDocument = HWPDocument("local_file_paths") // 로컬 파일 읽기

val hwpUrl: HWPDocument = HWPDocuemnt("some_url_path") // URL 경로로 부터 읽기

// do something...

Java

HWPDocument hwpLocal = new HWPDocument("local_file_path");

HWPDocument hwpUrl = new HWPDocument("file_url_path");

// do something...

  • 한글문서(HWP) 쓰기 (write)

kotlin

val hwp: HWPDocument = HWPDocument('...') // 한글 문서 읽기

// do something...

hwp.write('write_path') // 한글 문서 지정된 경로로 쓰기

Java

HWPDocument hwp = new HWPDocument('...'); // 한글 문서 읽기

// do something...

hwp.write('write_path'); // 한글 문서 지정 경로 쓰기

  • 한글문서(HWP) 복사하기 (copy)

kotlin

val hwp: HWPDocument = HWPDocument('...') // 한글 문서 읽기

val copied: HWPDocument = hwp.copy() // 한글 문서 복사하기

// do something...

Java

HWPDocument hwp = new HWPDocument('...');

HWPDocument copiedDocument = hwp.copy();

// do something

  • 한글문서(HWP) 이어 붙히기

kotlin

val original_hwp: HWPDocument = HWPDocument('...') // will be appended

val target_hwp: HWPDocument = HWPDocument('...') // target HWP Document

target_hwp + original_hwp
//or
target_hwp = target_hwp + original_hwp
//or
target_hwp = target_hwp.plus(original_hwp)

target_hwp.addParagraph(some_paragraph, original_hwp) // add paragraph in target_hwp

target_hwp.addParagraphs(some_paragraphs, original_hwp) // add paragraph list in target_hwp

// do something

Java

HWPDocument original_hwp = new HWPDocument('...'); // will be appended

HWPDocument target_hwp = new HWPDocument('...'); // target HWP Document

// target_hwp + original_hwp 
// not working! (WARNING)
// because Java does not have operator overloading 

target_hwp.plus(original_hwp);
//or
target_hwp = target_hwp.plus(original_hwp);
//or
HWPDocument new_hwp = target_hwp.plus(original_hwp);

target_hwp.addParagraph(some_paragraph, original_hwp); // add paragraph

target_hwp.addParagraphs(some_paragraphs, original_hwp); // add paragraph list
  • 한글 문서 내 수식(equation)을 latex(tex)문법으로 변환
val hwp = HWPDocument("...")

val tex = hwp.getEquationList()

// do something
HWPDocument hwp = new HWPDocument("...")
List<String> tex = hwp.getEquationList()

//do something

Credits for hwplib

A huge thanks to the author of hwplib for most of the work on libhwp.

License

Apache © accforaus

libhwp's People

Contributors

accforaus avatar

Watchers

James Cloos avatar

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.