Skip to content

Latest commit

 

History

History
71 lines (47 loc) · 1.51 KB

README.md

File metadata and controls

71 lines (47 loc) · 1.51 KB

Build Status

DuckX

DuckX is a library for creation of Office docx files

DuckX helps you to work with docx files quickly in C++.

Status

  • Documents (docx) [Word]
    • Read/Write/Edit

Quick Start

Here's an example of how to use duckx to read a docx file; It opens a docx file named file.docx and goes over paragraphs and runs and prints them:

#include <iostream>
#include <duckx.hpp>

int main() {

    duckx::Document doc("file.docx");   

    doc.open();

    for (auto p = doc.paragraphs(); p.has_next() ; p.next()) {
	for (auto r = p.runs(); r.has_next(); r.next()) {
            std::cout << r.get_text() << std::endl;
        }
    }
}

Note that you must use -lduckx flag to compile your cpp file
For example:

g++ sample1.cpp -lduckx

Install

It's easy as pie!

Compiling

The preferred way is to create a build folder

git clone https://github.com/amiremohamadi/DuckX.git
cd DuckX
mkdir build
cd build
cmake ..
cmake --build .

Requirements

Licensing

This library is available to anybody free of charge, under the terms of MIT License (see LICENSE.md).