1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

wineps.drv: Add partial support for changing page size.

This commit is contained in:
Piotr Caban 2024-06-04 21:21:45 +02:00 committed by Alexandre Julliard
parent 4047fb78a8
commit 71300e2385
3 changed files with 15 additions and 2 deletions

View File

@ -3110,6 +3110,8 @@ BOOL WINAPI PrintDocumentOnPrintProcessor(HANDLE pp, WCHAR *doc_name)
if (ret)
ret = PSDRV_ResetDC(data->ctx, devmode);
if (ret && devmode && (devmode->dmFields & DM_PAPERSIZE))
ret = PSDRV_WritePageSize(data->ctx);
free(devmode);
if (!ret)
goto cleanup;

View File

@ -397,6 +397,17 @@ static void write_cups_job_ticket( print_ctx *ctx, const struct ticket_info *inf
write_spool( ctx, cups_ap_d_inputslot, sizeof(cups_ap_d_inputslot) - 1 );
}
INT PSDRV_WritePageSize( print_ctx *ctx )
{
PAGESIZE *page = find_pagesize( ctx->pi->ppd, &ctx->Devmode->dmPublic );
if (page && page->InvocationString)
PSDRV_WriteFeature( ctx, "*PageSize", page->Name, page->InvocationString );
else
WARN("Page size not set\n");
return 1;
}
INT PSDRV_WriteHeader( print_ctx *ctx, LPCWSTR title )
{
char *buf, *escaped_title;
@ -444,8 +455,7 @@ INT PSDRV_WriteHeader( print_ctx *ctx, LPCWSTR title )
if (slot && slot->InvocationString)
PSDRV_WriteFeature( ctx, "*InputSlot", slot->Name, slot->InvocationString );
if (page && page->InvocationString)
PSDRV_WriteFeature( ctx, "*PageSize", page->Name, page->InvocationString );
PSDRV_WritePageSize( ctx );
if (duplex && duplex->InvocationString)
PSDRV_WriteFeature( ctx, "*Duplex", duplex->Name, duplex->InvocationString );

View File

@ -466,6 +466,7 @@ extern char PSDRV_UnicodeToANSI(int u);
extern INT PSDRV_WriteHeader( print_ctx *ctx, LPCWSTR title );
extern INT PSDRV_WriteFooter( print_ctx *ctx );
extern INT PSDRV_WritePageSize( print_ctx *ctx );
extern INT PSDRV_WriteNewPage( print_ctx *ctx );
extern INT PSDRV_WriteEndPage( print_ctx *ctx );
extern BOOL PSDRV_WriteMoveTo(print_ctx *ctx, INT x, INT y);