Page 1 of 1

landscape printing, how

Posted: Sat Jun 23, 2007 12:00 am
by rystrom
Hi All,

Our company has been using PDF-XChange for the last year or so and it has been working well for us. I have now received a request to print in landscape mode and can't figure out how to do it programmatically.

Our setup is that we populate Internet Explorer with a custom html page, change the default printer to PDF-XChange, and then command Internet Explorer to print via automation. At no time do we have access to the print dc.

I looked through the "Driver API messages" for registry communication with the driver but can't find anything like "General.Orientation".

After switching the default printer to PDF-XChange I also tried the SetLandscapeMode example in MSDN help on CWinApp::GetPrinterDeviceDefaults. However, it still printed out as portrait.




Posted: Mon Jun 25, 2007 9:32 am
by John - Tracker Supp

The MSDN example referred to changes only the LOCAL printer's properties (Local for the application) - not the GLOBAL (default) one.

Therefore - as you use an external application (IE) for printing and have no access to its internal code, you need to set the global printer properties.

To do this you can use a combination of the functions GetPrinter/SetPrinter with a Level parameter 8.

Pls see MSDN for more info



Posted: Fri Jun 29, 2007 7:38 pm
by rystrom
Thanks for the suggestion about GetPrinter/SetPrinter. I was able to get it to work.


Posted: Fri Jun 29, 2007 8:28 pm
by John - Tracker Supp
excellent Larry - thanks for coming back :)