Open Source C++ Library for PDF Documents

Generate, Edit, Manipulate & Convert PDF Files via Open Source C++ API.

LibHaru is an open source C++ library that enables software developers to generate PDF file format, currently, the API doesn't allow reading or edited existing PDF documents. Using the API you can generate PDF file - add text, lines, and annotations int it. Furthermore, you can also add images of PNG and JPEG format in the document. LibHaru also allows compressing the PDF document with the deflate-decode format and generates encrypted PDF documents.

LibHaru is written ANSI-C and can work both as static-library and shared-library. To use it with a C++ program you can compile it with any C++ compiler and use it as a static-library.


Previous Next

Getting Started with LibHaru

LibHaru is written in ANSI-C and to use it with C++, you can compile it with any compliant C++ compiler. First of all, you can download and extract the latest version of the API. There are several kinds of makefile, for every compiler, in the script directory. Build the library with an appropriate makefile.

After you unpack the library in your desired folder, you can cd into the folder and run the following command to make a lib file

NMAKE -f script/Makefile.msvcr

C++ Library to Generate PDF File Format

LibHaru has provided a set of features that enables software developers to generate PDF file format. Using the API you can create a new PDF document, set document object attributes, create a new page, set page object, set page description and save the document to a file ora memory stream.

Embed Images in PDF using C++

LibHaru enables software developers to embed JPEG and PNG images in PDF documents. Using the API you can get image size, width, height, bits per component and color space. Furthermore, you can set a color mask and mask image for the embedded image.