locked
No print ticket in PrinterExtensionContext object

    Question

  • I am writing a Windows Store device app for a printer, and I need access to the default print ticket when in the core "Start Experience" (i.e., not the More Settings/Advanced Settings experience).  I've already got a list of associated devices via DeviceInformation and PnPObject.  So, using the Id from the DeviceInformation object, I am getting the PrinterExtensionContext like this:

    object comContext = Windows.Devices.Printers.Extensions.PrintExtensionContext.FromDeviceId(device.Id);

    and wrapping it in an IPrinterExtensionContext, like this:

    IPrinterExtensionContext _prtExtContext = new PrinterExtensionContext(comContext);

    Afterwards, whenever I try to access the _prtExtContext.Ticket property (or comContext.PrintSchemaTicket via the debugger), I get the following COMException:

    System.Runtime.InteropServices.COMException was caught
      HResult=-2147483634
      Message=A method was called at an unexpected time. (Exception from HRESULT: 0x8000000E)
      Source=DeviceCompanionCommon
      ErrorCode=-2147483634
      StackTrace:
           at PrinterExtensionLib.IPrinterExtensionContext.get_PrintSchemaTicket()
           ... [project specific code]
           ... [project specific code]   

     I can get the IPrinterExtensionContext.DriverProperties, IPrinterExtensionContext.UserProperties, and IPrinterExtensionContext.PrinterQueue without exception.  

    Any ideas?  Do I have to be in a print experience to get the print ticket?

    Thanks

    

    Thursday, April 4, 2013 6:19 PM

All replies

  • Hi,

    Thank you for your question.

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
     
    Thank you for your understanding and support.


    Min Zhu
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 8, 2013 9:56 AM
    Moderator
  • I am getting the same error when it's an external standalone application (Currently, I am creating test code) or Start Experience.

    I have no problems though when I am inside the Advanced Print Settings or Printer Extension application.


    Wednesday, April 17, 2013 12:39 AM