CurrentJobSettings.CurrentPrintTicket.CopyCount

Dario Pispisa 1 Reputation point
2020-12-15T17:23:10.783+00:00

HI, I'm using this function:
CurrentJobSettings.CurrentPrintTicket.CopyCount
and then I have always as result 1 also if I print different copies.
Do You know why?

Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
658 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Alan Morris 1,161 Reputation points
    2020-12-15T21:11:01.877+00:00

    Does the print driver support the PrintTicket technology?

    If this is an XPS based print driver than the spool file is XPS. You can rename this file to a ZIP, then you can extract the print ticket. If it's not XPS based I'm sure there is some devmode conversion to generate a printticket but I do not know how to suck that out of the job devmode.

    I printed 7 copies. Open the [0].piece file.

    </psf:ParameterInit><psf:ParameterInit name="psk:JobCopiesAllDocuments"><psf:Value xsi:type="xsd:integer">7</psf:Value>

    48434-image.png


  2. Eleven Yu (Shanghai Wicresoft Co,.Ltd.) 10,726 Reputation points Microsoft Vendor
    2020-12-16T04:04:54.357+00:00

    Hi,

    PrintTicket.CopyCount Property corresponds to the Print Schema's JobCopiesAllDocuments keyword. The Print Schema and related technologies are available in Microsoft .NET Framework 3.0 and later versions of Microsoft .NET Framework.
    Please ensure .NET Framework 3.0 feature is enabled.
    https://learn.microsoft.com/en-us/dotnet/api/system.printing.printticket.copycount?view=net-5.0
    https://learn.microsoft.com/en-us/windows/win32/printdocs/printschema?redirectedfrom=MSDN

    I did some research and found below threads which might give you some help.

    System.Printing Namespace issues (ReachFramework)
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/fd4e4079-ffc8-4ab7-908c-1529e2f2522d/systemprinting-namespace-issues-reachframework?forum=netfxbcl
    How to get the count of number of pages being printed using Win32_PrintJob
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/6f2f41e4-8291-48d0-b0c6-71eb0683f8ad/how-to-get-the-count-of-number-of-pages-being-printed-using-win32printjob?forum=windowsgeneraldevelopmentissues
    Unable to get number of copies of a print job using PrintJobInfoCollection, C#, Winforms
    https://social.msdn.microsoft.com/Forums/en-US/5a71efeb-88bf-4bc5-85b4-3ca0fc70161c/unable-to-get-number-of-copies-of-a-print-job-using-printjobinfocollection-c-winforms?forum=windowsgeneraldevelopmentissues

    Thanks,
    Eleven

    ----------

    If the Answer is helpful, please click "Accept Answer" and upvote it. Thanks.