Open source PDF library for C/C++ application?

192,730

Solution 1

LibHaru

Haru is a free, cross platform, open-sourced software library for generating PDF written in ANSI-C. It can work as both a static-library (.a, .lib) and a shared-library (.so, .dll).

Didn't try it myself, but maybe it can help you

Solution 2

If you're brave and willing to roll your own, you could start with a PostScript library and augment it to deal with PDF, taking advantage of Adobe's free online PDF reference.

Solution 3

PDF Hummus. see for http://pdfhummus.com/ - contains all required features for manipulation with PDF files except rendering.

Solution 4

jagpdf seems to be one of them. It is written in C++ but provides a C API.

Solution 5

It depends a bit on your needs. Some toolkits are better at drawing, others are better for writing text. Cairo has a pretty good for drawing (it support a wide range of screen and file types, including pdf), but it may not be ideal for good typography.

Share:
192,730
ChrisN
Author by

ChrisN

Embedded Systems / C / C++ Win32 / MFC / C++ Scripting / Perl Web Development / Ruby / Node.js Homepage / GitHub / Twitter / LinkedIn / Delicious / LaunchPad

Updated on July 08, 2022

Comments

  • ChrisN
    ChrisN almost 2 years

    I want to be able to generate PDF output from my (native) C++ Windows application. Are there any free/open source libraries available to do this?

    I looked at the answers to this question, but they mostly relate to .Net.

  • Rui Carneiro
    Rui Carneiro about 15 years
    Can we read pdf files with LibHaru or we can only create?
  • Mark Ransom
    Mark Ransom over 14 years
    @Rui: only create, unfortunately.
  • Ami
    Ami almost 12 years
    It looks like muPdf is for rendering PDFs, not generating them?
  • Alex
    Alex over 11 years
    FWIW, I wrote a POCO wrapper for libHaru ( github.com/pocoproject/poco/tree/master/PDF ). We never released it but it is near-production-grade code.
  • RED SOFT ADAIR
    RED SOFT ADAIR about 10 years
    I did a large PDF-Export with Hummus recently and can recommend it. Probably not complete in terms of covering all features of the current PDFSpec (which is quite exhaustive), but easy to understand and good extensible through a callback class with a number of virtual functions (github.com/galkahana/PDF-Writer/blob/master/PDFWriter/…). Contains TIFF/JPEG handling and the freetype library for font handling.
  • matec
    matec about 10 years
    @vy32 Looking at the source I would say generating pdf-files is at best work in progress and not the primary goal of muPdf
  • swdev
    swdev almost 10 years
    This is good. But, as it use dated webkit, some pages may complaint (youtube for example)
  • Sam
    Sam almost 6 years
    have you been able to compile it as a dynamic linked library? Or does it support just static linked library?
  • freeze
    freeze over 5 years
    Unfortunately LibHaru doesn't support reading and editing PDF. So useless for me.
  • Eugene
    Eugene over 3 years
    It worth noting that the last commit was in 2015. The library is not being maintained at the moment.