none
Unable to Set InputBin and Orientation to a PrintTicket RRS feed

  • Question

  • Hello, 

    I am hoping that someone can help me here!  

    I have a .NET program that is able to send an XPS document to a redirected printer - the server has RD Easy Print Driver turned ON.  The program is able to pull the Print Capabilities and set the appropriate tray (INputBin) and orientation by modifying the printers default PrintTicket.  

    This works great on Server 2012, 2016 and Windows 10.  ON Windows 2008 R2 SP1, it is able to apply all the properties, but when the documents hits the printer, the device seems to be ignoring the InputBin and orientation settings in the PrintTicket.

    I am using System.Printing namespace.  This is a snippet of code to give you and idea of what I am doing:

       
    Dim PrintServer As Printing.PrintServer = New Printing.LocalPrintServer
    Dim pQueue As New Printing.PrintQueue(PrintServer, PrintQueueName)
    Dim printerCapXmlStream As IO.MemoryStream = pQueue.GetPrintCapabilitiesAsXml
    --> Read the XML and get the private input bin names < --
    'Clone the default print ticket
    Dim pticket As PrintTicket = pQueue.DefaultPrintTicket.Clone
    'Set the orientation
    If Portrait Then
    pticket.PageOrientation = PageOrientation.Portrait
    Else
    pticket.PageOrientation = PageOrientation.Landscape
    End If
        --> Get the XML pticket.GetXmlStream() -- apply the desired InputBin <--
    'Print the XPSDocument
        Dim xpsPrintJob As PrintSystemJobInfo = pQueue.AddJob("TestXPS", XPSFilePath, True, pticket)

    I can add all the details if needed.

    Any ideas on why these settings can't be applied (InputBin and Orientation) on Windows Server 2008 R2?  

    I appreciate any insights!

    Many Thanks, 
    Karen Siefken



    Karen Siefken

    Thursday, February 1, 2018 10:50 PM

All replies

  • Hi Hanika,

    Thank you for posting here.

    For your question, you code works well in Server 2012, 2016 and Windows 10, hence there is nothing wrong with your code. But in Windows 2008 R2 SP1, it fails. What is the version of your .net framework in Windows 2008 R2 SP1? Is it the same with the Server 2012, 2016 and Windows 10? Is there something different between Server 2012, 2016 and Windows 10 and 2008 R2 SP1?

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.




    Friday, February 2, 2018 10:35 PM
    Moderator
  • I think it's a virus. Have you tried turning it off and on again
    Friday, February 2, 2018 10:36 PM
  • Hi Hanika,

    Any update for your question? We are waiting for your feedback.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 6, 2018 6:16 AM
    Moderator