Link to home
Start Free TrialLog in
Avatar of cvhoyt
cvhoytFlag for United States of America

asked on

Good PDF generation library for C/C++?

I am looking to integrate PDF generated reports into an application that is written in c++.  I want them native to the application, not generated through a print driver or such.  I also need the application to be platform independent (Linux/AIX/Windows).  Is there a good library out there that does this?  I am trying to avoid the expense of Adobe's PDF API.  I have looked a little at the HaruPDF Library but want to explore all options before investing my time and $$$  in one solution over another.  Any help/advice/experience with this kind of tool/lib would be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of Hugh McCurdy
Hugh McCurdy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Carl Dula
Take a look at "enscript". This may or may not be installed on your AIX system, but if not it is free and can be downloaded at:
                http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/rpmgroups.html
This converts ascii to postscript, such that you could create ascii reports then convert.
If you can live with generating reports onto fixed size templates, here is the approach I took recently when required to print PDF certificates from a GUI E-learning application.

1) Use Adobe Acrobat to create a PDF form, fields added as placeholders for the data from the application. This is the template for all certificates in my app.
2) Use the FDF toolkit from Adobe (free and cross-platform) to generate FDF files with the data to be inserted e.g. course name, user name, date passed etc.
3) Use pdftk (open source and cross-platform) to merge data from FDF files onto the form template, outputting a flattened PDF for printing or storage.

I actually stripped out a lot of the pdftk source code, leaving just the FDF merge functionality, and compiled it into a DLL for use in my Windows app. The downside to this approach is you are putting data into fixed size fields on a page so layout is restricted, but this was not an issue in my situation.

PDF is a royal pain - maybe one of the open XML document formats would be more suitable?

Cheers,
  Chris
Avatar of cvhoyt

ASKER

Thanks what I figured all along.  Thanks for confirming.