How to Customize print setting (WSDA) RRS feed

  • Question

  • hello 

    I have a metro app in which I have a device( 3Dprinter) associated with the app via its device meta data. I can enumerate the associated printers and display in app which is showing 3D features from my GPD file (thease features are in different namespace uri) below code shows what i have done

     _features = ref new Platform::Collections::Vector<Platform::String^>;

     below code shows all these features exist in printcpability document. 
     if (!printHelper->FeatureExists(feature))
                rootPage->AddMessage(feature + ": feature does not exist");

    // for printcapability
    static wchar_t *g_pwszHeaderNS = L"";
    BSTR bstrNamespaceURI = SysAllocString(g_pwszHeaderNS);
     HRESULT hr = _spCapabilities->GetFeature(bstrFeature, bstrNamespaceURI, &spFeature);

    //for printticket
     static wchar_t *g_pwszHeaderNS1 = L"";
     BSTR bstrNamespaceURI1 = SysAllocString(g_pwszHeaderNS1);
     hr = _spTicket->GetFeature(bstrFeature, bstrNamespaceURI1, &spTicketFeature);

    both thease functions shows success result code .

     After submitting the job result is showing "PrintTicket saved successfully" but it is generating printicket 
    with default option in .gpd file not with my selected option from metro app.

     The app is from the metro sample collection "Device app for printers SDK sample(Print settings and print notifications)".

    so can you please tell me where i am going wrong . is there any changes i will have to do in metro app to add features which comes with different namespace uri.

    any quick help will be appreciated..!

    Saturday, April 26, 2014 7:25 AM

All replies

  • I believe the error is caused by your v4 print driver. If you are using the v4 sample driver from the SDK, the sample driver in the SDK is incomplete in that it does not implement the function convertDevModeToPrintTicket in the FabrikamPrintDriverV4-constraints.js file.

    Here is a sample implementation based off the rest of the v4 sample in the SDK.

    // file FabrikamPrintDriverV4-constraints.js

    function convertDevModeToPrintTicket(devModeProperties, scriptContext, printTicket) {

        /// <param name="devModeProperties" type="IPrinterScriptablePropertyBag">

        ///     The DevMode property bag.

        /// </param>

        /// <param name="scriptContext" type="IPrinterScriptContext">

        ///     Script context object.

        /// </param>

        /// <param name="printTicket" type="IPrintSchemaTicket">

        ///     Print ticket to be converted from the DevMode.

        /// </param>

        var printTicket = printTicket.XmlNode;

        var Root;

        // find psf:PrintCapabilities

        for (var ChildCount = 0; ChildCount < printTicket.childNodes.length; ChildCount++) {

            Root = printTicket.childNodes.item(ChildCount);

            if (Root.nodeName == "psf:PrintTicket") {

                // Add new attribute xmlns:psk3d="""

                Root.setAttribute("xmlns:psk3d", psk3dNs.toString());

                //            debug.innerHTML +=  psk3dNs.toString() + "<br>";



        // psk3d:Job3DToolCount



    You will also need to ensure that the V4 print driver manifest indicates that the dev mode map is enabled. Also include this in the inf so its copied over as part of the driver package.

    // changes to be made in the manifest FabrikamPrintDriverV4-manifest.ini









    //changes to be made in the FabrikamPrintDriverV4.inf





    More information on the dev mode map is located here

    With these changes the print ticket will match the namespace seen in the print capabilities.

    Tuesday, September 2, 2014 10:16 PM