4 Replies - 1204 Views - Last Post: 19 March 2010 - 02:02 AM Rate Topic: -----

#1 Guest_random9190*


Reputation:

C++ Outputting to a pdf file

Posted 18 March 2010 - 02:25 PM

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,

#include <iostream>
#include <string>

using namespace std;

int main()
{
	int num = 1000;
	string a = "Test word";
	int number[] = { 1, 3, 4, 5, 6, };
	string words[] = { word1, word2, word3 };

	cout << "Sample formatting for output. " << endl;
	cout << "\tTest indent/tab" << endl;
	cout << "\tTest indent/tab" << endl;
	cout << "\t\tTest indent/tab" << endl;
	cout << "\t\tTest indent/tab" << endl;
	cout << "\t\t\tTest indent/tab" << endl;
	cout << "\t\t\tTest indent/tab" << endl;

	cout << "Values in array number: "
	for ( int i = 0; i < (sizeof(number) / sizeof(int) ); i++ )
	{
		 cout << number[i] << " ";
	}

	cout << "Words in array words: "
	for ( int i = 0; i < (sizeof(words) / sizeof(string) ); i++ )
	{
		 cout << number[i] << " ";
	}

	return 0;
}






Is This A Good Question/Topic? 0

Replies To: C++ Outputting to a pdf file

#2 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 282
  • View blog
  • Posts: 1,456
  • Joined: 16-May 09

Re: C++ Outputting to a pdf file

Posted 18 March 2010 - 02:29 PM

Google it?

A simple query gave me:
libHaru
Check it's documentation for your guide. That's why they wrote a documentation for it :)

Or even PoDoFo.

This post has been edited by Anarion: 18 March 2010 - 02:30 PM

Was This Post Helpful? 1
  • +
  • -

#3 joesyuh  Icon User is offline

  • D.I.C Head

Reputation: 36
  • View blog
  • Posts: 174
  • Joined: 30-September 08

Re: C++ Outputting to a pdf file

Posted 18 March 2010 - 02:29 PM

Google is such an amazing tool.

Link
Was This Post Helpful? 0
  • +
  • -

#4 Guest_random9190*


Reputation:

Re: C++ Outputting to a pdf file

Posted 18 March 2010 - 03:40 PM

View Postjoesyuh, on 18 March 2010 - 01:29 PM, said:

Google is such an amazing tool.

Link


I looked at the libharu documentation and some examples, but I don't understand how to compile the code or what the command-line arguments are to save the pdf. Also after downloading the zip file, where do I extract the 2 folders? And does my source file have to be in the same directory as the header files for this library ?
Was This Post Helpful? 0

#5 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 282
  • View blog
  • Posts: 1,456
  • Joined: 16-May 09

Re: C++ Outputting to a pdf file

Posted 19 March 2010 - 02:02 AM

Go to it's download page, download the zip package for windows. Look at [ Here ] for guide on installation. It's pretty much easy :)

After you installed correctly, refer to [ This page ] to learn how to use it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1