views:

10523

answers:

6

I want to be able to generate PDF ouput 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.

+9  A: 

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

aku
LibHaru is working well. Thanks!
ChrisN
Can we read pdf files with LibHaru or we can only create?
Rui Carneiro
@Rui: only create, unfortunately.
Mark Ransom
+5  A: 

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.

Tyler
The PDF reference is really helpful for understanding the LibHaru API. Thanks!
ChrisN
You'd have to be exceptionally brave. With a fair bit of spare time thrown in for good measure.
Rowan
A: 
PDF Creator Pilot - PDF Library for C++, C#, Delphi, ASP, ASP.NET, VB,
VB.NET, VBScript, PHP, Python
Prakash
PDF Creator Pilot does not look like it is Open Source.
Tony Meyer
A: 

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.

Leon Timmermans
+3  A: 

I worked on a project that required a pdf report. After searching for online I found the PoDoFo library. Seemed very robust. I did not need all the features, so I created a wrapper to abstract away some of the complexity. Wasn't too difficult. You can find the library here:

http://podofo.sourceforge.net/

Enjoy!

A: 

Can LibHaru be used for reading existing PDF files and manipulate separate pages and save or display them on view as Image files? I need a cross platform for doing this...

Primoz Rome