Commit c4a54852 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

wineps.drv: PostScript header should be written by StartDoc instead of StartPage.

Otherwise a being created file has wrong signature if an application directly injects PostScript code. This patch fixes printing from Adobe PageMaker. Signed-off-by: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7338641e
......@@ -1433,7 +1433,6 @@ static void print_something(HDC hdc)
while (*p == '\r' || *p == '\n') p++;
}
todo_wine
ok(p && !memcmp(p, psadobe, sizeof(psadobe)), "wrong signature: %.14s\n", p ? p : buf);
DeleteFileA(file_name);
......
......@@ -397,15 +397,14 @@ INT PSDRV_StartPage( PHYSDEV dev )
{
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
TRACE("%p\n", dev->hdc);
if(!physDev->job.OutOfPage) {
FIXME("Already started a page?\n");
return 1;
}
if(physDev->job.PageNo++ == 0) {
if(!PSDRV_WriteHeader( dev, physDev->job.doc_name ))
return 0;
}
physDev->job.PageNo++;
if(!PSDRV_WriteNewPage( dev ))
return 0;
......@@ -421,6 +420,8 @@ INT PSDRV_EndPage( PHYSDEV dev )
{
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
TRACE("%p\n", dev->hdc);
if(physDev->job.OutOfPage) {
FIXME("Already ended a page?\n");
return 1;
......@@ -483,6 +484,13 @@ INT PSDRV_StartDoc( PHYSDEV dev, const DOCINFOW *doc )
ClosePrinter(physDev->job.hprinter);
return 0;
}
if (!PSDRV_WriteHeader( dev, doc->lpszDocName )) {
WARN("Failed to write header\n");
ClosePrinter(physDev->job.hprinter);
return 0;
}
physDev->job.banding = FALSE;
physDev->job.OutOfPage = TRUE;
physDev->job.PageNo = 0;
......@@ -501,6 +509,8 @@ INT PSDRV_EndDoc( PHYSDEV dev )
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
INT ret = 1;
TRACE("%p\n", dev->hdc);
if(!physDev->job.id) {
FIXME("hJob == 0. Now what?\n");
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment