PrintQueueWatch library Job.Transfer function access denied

Aug 12 2024 3:46 AM

 

The function Job.Transfer result is access denied.

I checked the following things and still the function Job.Transfer dosen't work
1.- Permissions.
  The user account running the application belong to the administrator group and has sufficient  permissions on both printer.
  Has permissions for print job, manage documents and manage printer.
2.- I create a instance of PrintQueeuWatch.PrinterInformation
    PrinterQueueWatch.PrinterInformation PrinterInfo = new PrinterQueueWatch.PrinterInformation("HP LaserJet P1006", PrinterQueueWatch.SpoolerApiConstantEnumerations.PrinterAccessRights.Printer_Access_Administer, true))
3.- The two printers status is online
4.- In the app.manifest is configured with requiredAdministrator

try
{
using (PrinterQueueWatch.PrinterInformation PrinterInfo = new PrinterQueueWatch.PrinterInformation("HP LaserJet P1006", PrinterQueueWatch.SpoolerApiConstantEnumerations.PrinterAccessRights.Printer_Access_Administer, true))
    {
        var job = PrinterInfo.PrintJobs.get_ItemByJobId(Id);  //the value of job is not null.
        if (job != null)
        {
            job.Transfer("Microsoft Print to PDF", false);
        }
        else
        {
            System.Diagnostics.Debug.WriteLine("Print job not found.");
        }
    }
}
catch (Exception ex)
{
    System.Diagnostics.Debug.WriteLine("Error: " + ex.Message);

}

 


Answers (1)