LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-11-2020, 10:48 AM   #1
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Rep: Reputation: 2
how to get hard copy( print out ) of output or report in c++ in codeblocks.


hi to all, I've centos7.5 and codeblocks in VM. I am trying to get report of ( or file in C++ ) in hard copy by print like option as in gui. but have no idea. please any suggetion.
 
Old 04-11-2020, 12:31 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,304

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
No programmer, but if you can view them on a screen, there are numerous copy/paste options. It not, email then to yourself or put the code on google drive?
 
Old 04-11-2020, 12:38 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
yes i think you just got to high light the messages, and right click or click around in that message window, and find copy all then paste it into a separate text file, then you can print it out. yes?
 
Old 04-11-2020, 02:00 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by rahulvishwakarma View Post
hi to all, I've centos7.5 and codeblocks in VM. I am trying to get report of ( or file in C++ ) in hard copy by print like option as in gui. but have no idea. please any suggetion.
You've been using codeblocks for SIX YEARS now...and you haven't read the manual? Their own software guides and wiki tell you how to print, and offer numerous samples on how to configure page size, etc.

Past that, as others have said, you can copy/paste into whatever you want, and print from there.
 
Old 04-12-2020, 04:18 AM   #5
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
thanks for reply. actually i want to embed code in my c++ application so that my software have print functionality.

Last edited by rahulvishwakarma; 04-12-2020 at 04:21 AM.
 
Old 04-12-2020, 09:50 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by rahulvishwakarma View Post
thanks for reply. actually i want to embed code in my c++ application so that my software have print functionality.
Ok, so you *WRITE YOUR CODE* to have a print function. So post what you've written, and tell us where you're stuck.
 
Old 04-12-2020, 10:04 AM   #7
SoftSprocket
Member
 
Registered: Nov 2014
Posts: 399

Rep: Reputation: Disabled
Quote:
Originally Posted by rahulvishwakarma View Post
hi to all, I've centos7.5 and codeblocks in VM. I am trying to get report of ( or file in C++ ) in hard copy by print like option as in gui. but have no idea. please any suggetion.
You'll get better answers by asking a better question. From your subsequent post it would seem your question is "how to write to a printer in C or C++"?

If that's correct:
You can write directly to the device by opening it with popen (stdio.h) and then using the standard stream functions but this isn't very portable.

A better approach might be to use the CUPS library. Here's a good place to start:
https://www.cups.org/doc/cupspm.html
 
1 members found this post helpful.
Old 04-12-2020, 09:36 PM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195
Quote:
Originally Posted by rahulvishwakarma View Post
thanks for reply. actually i want to embed code in my c++ application so that my software have print functionality.
That is quite a different question than the thread title suggests. You might want to review the Site FAQ pages for help in forming your questions, and in particular the link you will find there to the article How To Ask Questions the Smart Way, which has many good tips!

Good luck!
 
1 members found this post helpful.
  


Reply

Tags
c++, codeblocks



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
perl - get print to print *now* in cgi script (hard to explain). Linicks Programming 6 12-24-2015 08:14 AM
Geany, Codeblocks, PCMan, Firefox often crash in FreeBSD Mr_Shameless *BSD 5 08-20-2009 10:00 PM
codeblocks build errors g++: command not found yukapuka Linux - Software 3 02-17-2009 03:09 PM
Setting up CodeBlocks on Ubuntu tm2383 Programming 4 12-12-2008 03:53 PM
Print-to-file print driver to print PDF Bill Fox Linux - General 3 05-02-2006 04:15 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration