Shoutbox

C++ Printing - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: C++ Printing (/showthread.php?tid=36510)

C++ Printing by DJeX on 01-05-2005 at 11:37 PM

I want to use the Print() function to print the contents of my form but I want to print it landscape not portrait. How would I do this?


RE: C++ Printing by RaceProUK on 01-06-2005 at 05:27 PM

Does the documentation for Print() tell you how? If not, then you may need to look at part of the API, probably something like the Print Spooler API or something.


RE: C++ Printing by Geniuzzz on 01-07-2005 at 10:57 AM

Hi,

I would try this:


  1. use getPrinter to retrieve the printer settings into a PRINTER_INFO_2 structure
  2. modify the orientation inside that structure (the orientation is a member of the DEVMODE which is a member of  PRINTER_INFO_2
  3. use setPrinter
    [/list]

    and then print whatever you want to print...

    have fun:P
    Geniuzzz

RE: C++ Printing by DJeX on 01-07-2005 at 08:24 PM

How would I put that in code?

Like this (Sorry i'm new to C++):

---------------------------------------------------------------------

getPrinter(DefultPrinter) = PRINTER_INFO_2;

PRINTER_INFO_2->Orientation.Landscape;

setPrinter;
---------------------------------------------------------------------


I use Bornald C++ Builder 6 so the "->" is how you use functions and properties of a component or command. Kinda like when Visual Basic uses the peroid "." to do the same.


RE: C++ Printing by RaceProUK on 01-08-2005 at 01:13 PM

quote:
Originally posted by DJeX
I use Bornald C++ Builder 6 so the "->" is how you use functions and properties of a component or command. Kinda like when Visual Basic uses the peroid "." to do the same.
You do know that is part of the language, not just some Borland thing?
I assume you have a book on C++ to learn from. If not, then get something like 'Teach Yourself C++ in 21 Days'.
RE: C++ Printing by DJeX on 01-08-2005 at 10:44 PM

Yea I got that book