As OEM print driver vendor, how to support non-standard paper size in PTConvertDevModeToPrintTicket() API?

qi an 1 Reputation point
2020-11-19T06:35:24.77+00:00

We are developing a print driver. To better support Print Ticket for win32 applications, we implemented IPrintTicketProvider COM interface. But it is found that when applications call PTConvertPrintTicketToDevMode(), and the paper size in Print Ticket is vendor defined paper size (aka non-standard paper size, refer to https://learn.microsoft.com/en-us/windows-hardware/drivers/print/supporting-vendor-defined-paper-sizes), the paper size in converted DevMode is always default paper size. It seems system don't recognize the private option in Print Ticket.

Per the MSDN https://learn.microsoft.com/en-us/previous-versions/windows/hardware/drivers/ff554354(v=vs.85), we could set corresponding bit to indicate system not to do DEVMODEW-to-print ticket or print ticket-to-DEVMODEW conversions, then PTConvertPrintTicketToDevMode() can convert non-standard paper size correctly.

Could any print experts tell me whether this is correct method to support non-standard paper size in PTConvertDevModeToPrintTicket() API? Thanks

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,591 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karlie Weng 14,031 Reputation points Microsoft Vendor
    2020-11-20T06:25:59.723+00:00

    Hey @qi an

    Sorry I'm not print expert, with "windows server print" tag, we mainly focus on the deployment of printer server.

    Thanks for your understanding !

    ----------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards
    Karlie