I think there is a way, but not standard in c++. Look up in google if there exist libraries for that.
You said you're new in c++, i think you should learn the basis first, and then learn things like this.
My main program needs to output a lot of technical information to a printer. I could do this in Basic. But I'd have to spend too much to buy a visual new basic package and reprogram so that it would run on Vista and Windows 7. A programming system seems useless if it can't do this.
Is your printer those line dot-matrix printer or those nowadays deskjet, laserjet, watever jet printer?
In general to get nice print-out require a lot of "printing knowledge". Back in the Visual Basic days, we use Crystal Report to help us do the formatting and printing.
Nowadays the rage is to leverage on existing popular software and uses it's printing API (if it expose to outside world) to help us do the print-out. Adobe is one very popular software that can deliver very nice looking print-out. In a lot of commercial vendor product I evaluate, their technical information come in PDF format.
Again, unlike Java where we have iText, PDFBox, C++ lack some libraries for us to "talk" where we can leverage on the PDF printing features to help us do printing.
Edit: Java SDK do have Printing API but once you play around, you find you need a lot of "printing knowledge" and a few try-out program I uses give sub-optimal print-out. That is when I feel Adobe is the way to go. Their software printing gives really good print-out so I believe they maintain a dedicated team of developers on that area.