如:
....:=A4;
....:=zdy(自定义);
谢谢!

解决方案 »

  1.   

    用FASTREPORT实现的方法:
    frprint.page.pgsize:=256;
    frprint.page.pgheight:=46.6
    我用了是可以的你试试吧.
      

  2.   

    和你的打印机本身有关系,win2000支持打印机最大打印尺寸,不支持自定义大小的
      

  3.   

    哦 谢了,我用的是QREPORT.
      

  4.   

    Var
      ADevice,ADriver,APort:Array[0..255] Of Char;
      DeviceHandle:THandle;
      PDevMode:PDeviceMode;
      I:Integer;
    begin
      Printer.GetPrinter(ADevice,ADriver,APort,DeviceHandle);
      //如果DeviceHandle为0 ,则强制设置PRINTERINDEX,然后在GETPRINTER
      If DeviceHandle=0 Then
      Begin
        Printer.PrinterIndex:=Printer.PrinterIndex;
        Printer.GetPrinter(ADevice,ADriver,APort,DeviceHandle);
      End;
      //强制执行GETPRINTER后,如果DEVICEHANDLE依然为0的话,系统无可以连接的打印机
      //如果有的话用GLOBALLOCK函数得到指向PDEVICEMODE的结构的POINTER;
      Lb_Printers.Items.Clear;
      If DeviceHandle=0 Then
        Lb_Printers.Items[0]:='系统没有连接的打印机!'
      Else
        PDevMode:=GlobalLock(DeviceHandle);  IF PDevMode=nil then ShowMessage('error~');
      With PDevMode^ Do
      Begin
        DmFields:= dmFields Or DM_PAPERSIZE;
        DmPaperSize:=0;
         //设置纸张长度
        DmFields:= dmFields Or DM_PAPERLENGTH;
        DmPaperLength:=StrToInt(Edit1.Text);
        //设置纸张宽度
        DmFields:= dmFields Or DM_PAPERWIDTH;
        DmPaperWidth:=StrToInt(Edit2.Text);    dmFields:= dmFields Or DM_COPIES;
        dmCopies:=1;
      End;
      printer.BeginDoc;
      printer.Canvas.Font.Name := '宋体';
      printer.Canvas.Font.Style := [fsBold];
      printer.Canvas.Font.Size := 11;
      printer.Canvas.TextOut(100,0, 'AA');
      Printer.EndDOc;  //释放结构
      If Not DeviceHandle=0 Then
        GlobalUnlock(DeviceHandle);
    98下好象不正确
    嘿咻嘿咻