[Bug 6907] New: Delphi applications printing bug

Wine Bugs wine-bugs at winehq.org
Fri Dec 15 03:38:34 CST 2006


http://bugs.winehq.org/show_bug.cgi?id=6907

           Summary: Delphi applications printing bug
           Product: Wine
           Version: 0.9.27.
          Platform: Other
        OS/Version: other
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: wine-gdi-(printing)
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: paolo.salvan at xvision.it


I'm using Wine 0.9.27 and Ubuntu 6.06.

I've problems when printing from Delphi Apps that use QReport (the
default reporting engine for most Delphi versions), and after some
hacking I've prepared a minimal executable and isolated a trouble:

it seems that Delphi printing over a Canvas works only if I show the
system PrintDialog or the PrinterSetupDialog befor printing, and I
press OK in this dialog: printing directly to the default printer
doesn't work under Wine, but works regularly under Windows ("doesn't
work" meens that nothing is encoded in the printing spool... and the
only error that is shown is "fixme:psdrv:PSDRV_EndPage Already ended a
page?")

Ie, this code works both under Windows and Wine:

procedure TForm1.Button2Click(Sender: TObject);
var SetupDialog: TPrinterSetupDialog;
begin
    SetupDialog:= TPrinterSetupDialog.Create(Application);
    SetupDialog.Execute;

    with Printer do
    begin
        BeginDoc;
        Canvas.TextOut(100, 100, 'Test');
        EndDoc;
    end;
end;

...while this code works only under Windows:

procedure TForm1.Button1Click(Sender: TObject);
begin
    with Printer do
    begin
        BeginDoc;
        Canvas.TextOut(100, 100, 'Test');
        EndDoc;
    end;
end;

Enabling deeper log on "psdrv", and comparing the log files of the two
version ('-' is the non-working one, "+" is the working one...), I've
found something interesting:

[...]
 trace:psdrv:PSDRV_MergeDevmodes Changing page to A4 2099 x 2970
 trace:psdrv:PSDRV_FindPrinterInfo No 'Paper Size' for printer
'PostScript-Printer-1'
 trace:psdrv:PSDRV_FindPrinterInfo No 'FontSubTable' for printer
'PostScript-Printer-1'
-trace:psdrv:PSDRV_CreateDC (L"WINEPS.DRV" L"PostScript-Printer-1" L""
0x179bd8)
+trace:psdrv:PSDRV_CreateDC (L"WINEPS.DRV" L"PostScript-Printer-1"
L"LPT1:" (nil))
+trace:psdrv:PSDRV_UpdateDevCaps ImageableArea = 0,0 - 2479,3508:
PageSize = 2479x3508
+trace:psdrv:PSDRV_UpdateDevCaps devcaps: horzSize = 209mm, vertSize =
297mm, horzRes = 2479, vertRes = 3508
+trace:psdrv:PSDRV_SelectFont FaceName = L"" Height = 100 Italic = 0
Weight = 400
+trace:psdrv:PSDRV_SelectPen hpen = 0x60 colour = 00000000
[...]
+trace:psdrv:PSDRV_MergeDevmodes Changing page to A4 2099 x 2970
+trace:psdrv:PSDRV_FindPrinterInfo No 'Paper Size' for printer
'PostScript-Printer-1'
+trace:psdrv:PSDRV_FindPrinterInfo No 'FontSubTable' for printer
'PostScript-Printer-1'
+trace:psdrv:PSDRV_CreateDC (L"WINEPS.DRV" L"PostScript-Printer-1"
L"LPR:PostScript-Printer-1" 0x173180)
 trace:psdrv:PSDRV_MergeDevmodes Changing orientation to 1 (Portrait)
 trace:psdrv:PSDRV_MergeDevmodes Changing page to A4 2099 x 2970
 trace:psdrv:PSDRV_MergeDevmodes Changing Scale to 100
 trace:psdrv:PSDRV_MergeDevmodes Changing Copies to 1
 trace:psdrv:PSDRV_MergeDevmodes Trying to change to unsupported bin 7
 trace:psdrv:PSDRV_UpdateDevCaps ImageableArea = 0,0 - 2479,3508:
PageSize = 2479x3508
 trace:psdrv:PSDRV_UpdateDevCaps devcaps: horzSize = 209mm, vertSize =
297mm, horzRes = 2479, vertRes = 3508
 trace:psdrv:PSDRV_SelectFont FaceName = L"" Height = 100 Italic = 0
Weight = 400
 trace:psdrv:PSDRV_SelectPen hpen = 0x60 colour = 00000000
 trace:psdrv:PSDRV_SelectBrush hbrush = 0x44
 trace:psdrv:PSDRV_SelectFont FaceName = L"" Height = 100 Italic = 0
Weight = 400
 trace:psdrv:PSDRV_WriteHeader '""'
-warn:psdrv:PSDRV_WriteHeader WriteSpool error
 trace:psdrv:PSDRV_SelectFont FaceName = L"MS Sans Serif" Height = -33
Italic = 0 Weight = 400
 trace:psdrv:PSDRV_SelectBrush hbrush = 0x5c4
 trace:psdrv:PSDRV_ExtTextOut (x=0, y=0, flags=0x00000002, str=(null),
count=0, lpDx=(nil))
-warn:psdrv:PSDRV_WriteNewPage WriteSpool error
-warn:psdrv:PSDRV_WriteNewPage WriteSpool error
-warn:psdrv:PSDRV_WriteNewPage WriteSpool error
-warn:psdrv:PSDRV_WriteNewPage WriteSpool error
[...]
..and here start a long list of errors;

What seems to cause trobles is the different way of calling
PSDRV_CreateDC:

-trace:psdrv:PSDRV_CreateDC (L"WINEPS.DRV" L"PostScript-Printer-1" L""
0x179bd8)
+trace:psdrv:PSDRV_CreateDC (L"WINEPS.DRV" L"PostScript-Printer-1"
L"LPT1:" (nil)) 


I've prepared a minimal printing sample that also print using QReport (with or
without PrinterSetup dialog), and it never works...BTW, errors logged in PSDRV
are similar to Canvas errors, so solving the Canvas Printing trouble can help
solving QReport trouble

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list