Solved

Changing Printer orientation

Posted on 1997-03-24
4
503 Views
Last Modified: 2006-11-17
Accessing a TPrinter object thru a TPrintDC object, I need to be able to change the printer orientation based on real-time information.  What command / function is it that allows this?  I believe I could get the the orientation using the GetDeviceCaps(DC_ORIENTATION) function, but I have no idea to get it!
0
Comment
Question by:jbeane
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 

Author Comment

by:jbeane
ID: 1162433
Edited text of question
0
 

Author Comment

by:jbeane
ID: 1162434
Adjusted points to 100
0
 
LVL 4

Accepted Solution

by:
marko020397 earned 100 total points
ID: 1162435
Try this:

  TPrinter printer;
  TPrintDialog::TData *dlgData = &printer.GetSetup ();
  DEVMODE *dataIn = (DEVMODE *)dlgData->GetDevMode ();
  dataIn->dmFields |= DM_ORIENTATION;
  dataIn->dmOrientation = DMORIENT_LANDSCAPE;
  printer.Print (this, printout, TRUE);

0
 

Author Comment

by:jbeane
ID: 1162436
My actual implementation was as follows:

DEVMODE *devMode = (DEVMODE *)Printer->GetSetup().GetDevMode();
devMode->dmOrientation = Orientation;

//Initialize Printer Dc
DC = new TPrintDC(      Printer->GetSetup().GetDriverName(),
      Printer->GetSetup().GetDeviceName(),
                Printer->GetSetup().GetOutputName(),
      devMode);


Thanks for the help
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question