The PoDoFo library is a free, portable C++ library. It can parse existing PDF files and create new ones from scratch. Optional dependencies are cppunit and lua.