打印机打印EMF文件方向不起作用?解决思路

打印机打印EMF文件方向不起作用?
唉。搞个打印程序问题多多啊。

现在已经有一个EMF文件(虽然是我生成的,但是文件可以查看,没问题。),提供真实打印机名称和Devmode。
我的代码很乱,就不贴了。
 流程是CreateDC->StartDoc-> StartPage ->  渲染到DC-> EndPage -> EndDoc   。
我使用的渲染代码如下
                                RECT ldRect;
ldRect.left  = 0 ;
ldRect.right  = GetDeviceCaps (lhPrinterDC, HORZRES) ;
ldRect.top   = 0 ;
ldRect.bottom = GetDeviceCaps (lhPrinterDC, VERTRES) ;

HENHMETAFILE hemf = GetEnhMetaFileW(lswEmfFileName);
PlayEnhMetaFile(lhPrinterDC, hemf, &ldRect);
DeleteEnhMetaFile(hemf);

能正常打印竖着的文档内容,但打印横着的文档内容时,会将这个横着的打印成竖着的。  
我检查了我的DEVMODE的dmOrigitation参数,是DMORIENT_LANDSCAPE没错,并且dmFields里也包含了DM_ORIENTATION标记。  
研究这个问题两天了,始终打印不出横着的。求指教啊!  
------解决方案--------------------
仅供参考:


VB3 How to Set Landscape or Portrait for Printer from VB App
Last reviewed: January 9, 1997
Article ID: Q80185  
The information in this article applies to: 
- Standard and Professional Editions of Microsoft Visual Basic for 

  Windows, versions 2.0 and 3.0

- Microsoft Visual Basic programming system for Windows, version 1.0 


SUMMARY
Some printers support changing the orientation of the paper output to landscape. With the Windows API Escape() function, you can change the settings of the printer to either landscape or portrait. In addition, if you have one of the following products, you can use the Common Dialog box to allow users to set the mode inside a Visual Basic Application: 

Visual Basic version 1.0 Professional Toolkit 
Professional Edition of Visual Basic version 2.0 
Standard or Professional Edition of Visual Basic version 3.0 

Below is an example showing how to invoke the Windows API Escape() function from Microsoft Visual Basic. 
NOTE: The Windows API Escape() function is provided in Windows versions 3.0 and 3.1 for backward compatibility with earlier versions of Microsoft Windows. Applications are supposed to use the GDI DeviceCapabilities() and ExtDeviceMode() functions instead of the Escape() function, but neither DeviceCapabilities() nor ExtDeviceMode() can be called directly from Visual Basic. This is because they are exported by the printer driver, not by the Windows GDI. The only way to use ExtDeviceMode() or DeviceCapabilities() in Visual Basic is to create a DLL and call them from there. 



MORE INFORMATION
Normally, output for the printer is in portrait mode, where output is printed horizontally across the narrower dimension of a paper. In landscape mode, the output is printed horizontally across the longer dimension of the paper. 

You can use the Escape() function to change the orientation of the printer by passing GETSETPAPERORIENT as an argument. When you initially print text to the printer, Visual Basic will use the currently selected orientation. Sending the Escape() function will not take effect until you perform a Printer.EndDoc. After you perform a Printer.EndDoc, output will print in the orientation that you have selected. 

To determine if your printer supports landscape mode, do the following: 


From the Windows Program Manager, run Control Panel. 

From the Control Panel, select the Printers icon. 

From the Printers dialog box, choose the Configure button. 

The Configure dialog box will contain an option for landscape orientation if landscape is supported on your printer. 

How to Check the Current Orientation of the Printer