?
Solved

Changing Printer orientation

Posted on 1997-03-24
4
Medium Priority
?
505 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 300 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

752 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