none
Virtual Printer Owner Name RRS feed

  • Question

  • Currently Virtual Printer installed on my document generation server and using C# for generating and Printing the documents. When i print the document its taking my Machine login user as a 'Owner',  How can set a owner dynamically using C # so that all printing goes theier account.

    Appreciated your help in advance.

    Thursday, February 26, 2015 6:46 PM

All replies

  • Could you please share your code used to print?

    Fouad Roumieh

    Thursday, February 26, 2015 6:58 PM
  • Sir,

    Here is the sample code:

    PrintDocuments printDocumentCall = new PrintDocuments();

    if (strDocType == "application/msword")
    strOutputMsg = printDocumentCall.FnPrintDocument(strPath, dtPrintDocIDList.Rows[i][2].ToString(), Convert.ToInt16(dtPrintDocIDList.Rows[i][3]));
       
    else if (strDocType == "application/vnd.ms-excel")
       strOutputMsg = printDocumentCall.FnPrintExcel(strPath, dtPrintDocIDList.Rows[i][2].ToString(), Convert.ToInt16(dtPrintDocIDList.Rows[i][3]));
    else
    strOutputMsg = printDocumentCall.FnPrintAllTypeDocument(strPath, dtPrintDocIDList.Rows[i][2].ToString(), Convert.ToInt16(dtPrintDocIDList.Rows[i][3]));

    Thursday, February 26, 2015 7:24 PM
  • I advise these threads for this:

    http://stackoverflow.com/questions/153087/getting-setting-file-owner-in-c-sharp

    http://stackoverflow.com/questions/5368825/taking-ownership-of-a-file-or-folder?lq=1

    http://processprivileges.codeplex.com/


    Fouad Roumieh

    Thursday, February 26, 2015 8:52 PM
  • I set the fileowner but when I send the document for prining, still its taking machine login user, not file owner.  Any sample code please

    Friday, February 27, 2015 3:19 PM
  • I set the fileowner but when I send the document for prining, still its taking machine login user, not file owner.  Any sample code please


    Thursday, March 19, 2015 9:01 PM