Hi guys,

I'm working on a side project for a friend and I'm looking for a C++ library that allows me to put bunch of paragraphs in a PDF format. Anyone know any good libraries that can do this as simply as possible?

It will be just paragraphs and paragraphs that need to be added to a pdf with normal margins and Times font! I'm looking for a library that I can use quick so I won't have to spend much time on this... not too familiar with this area that's why I'm hoping one of you has done somehting similar and can point me in the right direction!

Thanks! :)

The main library that is used for manipulating PDF files is the Poppler library (home-page, wiki).

This is the library that is used for virtually every tool in the Unix/Linux world that deals with PDFs.

However, you should consider using an existing tool. The set of command-line tools that come with poppler on Linux can do an amazing amount of things. And as far as a basic PDF generator from raw text, assuming you want to apply some standard font and formatting (margins, etc..), you should really consider using LaTeX, and use the provided PDFLatex program to generate the PDF. If you do that, all you'll need is to create a LaTeX file (with the fonts and formatting you prefer), and insert your "paragraphs" of text into it, and then send that generated file to the PDFLatex program. This would be very easy to do in C++, in fact, you could even do it with Bash/Batch script (with standard find-and-replace commands).

Hey Mike, one more question. What about the same thing but for mobile applications?

Thanks.

Poppler works on both Android and Mac OSX. LaTeX compilers do too. I'm not sure about Mac iOS (iPhone / iPad). And I really don't know much about mobile app development, so I can't really help you much there. I just know that iOS is intentionally very restrictive, it's not really made to program anything serious, unless you work for Apple. The other option is to use cloud-based services.

Member Avatar for iamthwee

If you go for a cloud based app you have all areas covered.

Of course this caveat requires internet connectivity but this is kinda the defacto nowadays. And FPDF, if you use PHP is your friend.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.