Hi,
I need to out my results from my program into a pdf file, but I'm not sure how. Are there any easy to use libraries to do this ? And could you post step by step on how to use the library ?
For example, how would I get the exact same output I have in this test program, but in pdf file format ?
Thanks,
The thing is that, although you could open a pdf file using an fstream, you'll have to edit it in binary mode, because a pdf is not raw text. And that's going to be a rather difficult task. Check boost. boost has plenty of good stuff.
I looked at the libharu documentation and some examples, but I don't understand how to compile the code and what the command-line arguments are to save the pdf.
It looks like a pretty suitable choice to me. Google more about it. See if you find anything. If you really find nothing, google for another pdf library.
Does the C++ program need to produce the PDF file? Can't you just copy-paste your results into OpenOffice and export it as a PDF? Seems awfully bizarre to have to make a program that outputs such trivial output into a complex file format like a pdf.
Generally it's much easier to create a pdf file than to display it. If you know the fundamentals (and with some experience) it's quite straightforward to create a simple pdf file (containing only text!).