Open source PDF library for C/C++ application?
Solution 1
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.
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, 2022Comments
-
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 about 15 yearsCan we read pdf files with LibHaru or we can only create?
-
Mark Ransom over 14 years@Rui: only create, unfortunately.
-
Ami almost 12 yearsIt looks like muPdf is for rendering PDFs, not generating them?
-
Alex over 11 yearsFWIW, 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 about 10 yearsI 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 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 almost 10 yearsThis is good. But, as it use dated webkit, some pages may complaint (youtube for example)
-
Sam almost 6 yearshave you been able to compile it as a dynamic linked library? Or does it support just static linked library?
-
freeze over 5 yearsUnfortunately LibHaru doesn't support reading and editing PDF. So useless for me.
-
Eugene over 3 yearsIt worth noting that the last commit was in 2015. The library is not being maintained at the moment.