不同的打印机即使纸张是一样的,可是可打印区域也是不同的,我的打印程序如何不受他们的影响??

解决方案 »

  1.   

    那个 printinfo 数据结构中有一个DC,是获取的打印机DC,你用它获取设备能力,选择X和Y的点数就行了
    当然,这个里面看的是pixel格式的OnBeginprint中的入口参数
      

  2.   

    使用 pDC->GetDeviceCaps(PHYSICALOFFSETX) 获取不可打印区域
    PHYSICALOFFSETX 
         For printing devices: the distance from the left edge of the physical page to the left edge of the printable area, in device units. For example, a printer set to print at 600 dpi on 8.5-by-11-inch paper, that cannot print on the leftmost 0.25-inch of paper, has a horizontal physical offset of 150 device units.  
    PHYSICALOFFSETY 
         For printing devices: the distance from the top edge of the physical page to the top edge of the printable area, in device units. For example, a printer set to print at 600 dpi on 8.5-by-11-inch paper, that cannot print on the topmost 0.5-inch of paper, has a vertical physical offset of 300 device units.