Skip to content

PrintJob.Transfer #11

@jciglsias

Description

@jciglsias

I'm using the function PrintJob.Transfer but is not working, I got an Win32Exception "access denied"
This is what I'm doing
I'm running the app under admin privileges
try
{
using (PrinterQueueWatch.PrinterInformation PrinterInfo = new PrinterQueueWatch.PrinterInformation("HP LaserJet P1006", PrinterQueueWatch.SpoolerApiConstantEnumerations.PrinterAccessRights.Printer_Access_Administer, false))
{
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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions