PDF is a more common format that is relatively stable to office.
The easiest way to do this is txt, which is easy to read and write.
But the PDF format is too troublesome, according to read TXT, can only get garbled, write not even think about it.
Recently encountered this problem, let the results PDF output, checked, chose the pdflib.
Trial version, have to say very fucked, background icon, will be next.
: http://download.csdn.net/detail/u010477528/8368807
Put a few pieces of code on it.
#include "pdflib.h" #pragma comment (lib, "Pdflib.lib")
Note the introduction of library files, DLL files are either configured in the system environment, or put into the project directory, the debug directory or the home directory.
PDF *p;
PDF * _cdecl pdf_new ();
Create a PDF and, if it fails, return a value of 0. To detect the return, (PDF *) convert it.
int pdf_begin_document (P, "Hello.pdf", 0, "");
Creates a PDF document with a return value of type int, or 1, which indicates that the creation failed.
Create a new page
Pdf_begin_page_ext (P, A4_width, A4_height, "");
System font
Pdf_load_font (P, "Helvetica-bold", 0, "host", "");
Loading fonts
Pdf_setfont (P, font, 24);
Start position
Pdf_set_text_pos (P, 50, 700);
First line output
Pdf_show (P, "Hello, world!");
Next line
Pdf_continue_text (P, "(says C)");
Close page
Pdf_end_page_ext (P, "");
Close Document
Pdf_end_document (P, "");
PDF format output from C + + learning