Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6106701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:06:29+00:00 2026-05-23T14:06:29+00:00

I am not sure if this is to with a threading issue or not.

  • 0

I am not sure if this is to with a threading issue or not.

I am printing labels to a standard windows printer. The label is drawn in GDI and then passed to another object which prints it on a background thread.

I am using a BackgroundWorker for this process. LabelPrinter.Print(Label as PrintLabel) starts the backgroundWorker and passes the label details to it. The PrintPage eventhandler renders the page and sends it to the printer.

The issue is, users occasionally get an error stating:

System.Drawing.Printing.InvalidPrinterException: Settings to access printer '\\printserver\label' are not valid.
   at System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal()
   at System.Drawing.Printing.PrinterSettings.GetHdevmode(PageSettings pageSettings)
   at System.Drawing.Printing.PrintController.OnStartPrint(PrintDocument document, PrintEventArgs e)
   at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e)
   at System.Drawing.Printing.PrintController.Print(PrintDocument document)
   at System.Drawing.Printing.PrintDocument.Print()

Users only get this occasionally, although I am informed it is worse when there print multiple labels in succession (few minutes between labels). They will be able to print labels all day, when they will suddenly hit this error and get it 4 or 5 times, then the problem will go usually go away.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:06:29+00:00Added an answer on May 23, 2026 at 2:06 pm

    This is a problem that’s induced by the printer driver. The call to the native DocumentProperties() API function failed. Unfortunately it doesn’t have a good way to indicate exactly what is wrong, an error return doesn’t mean anything more than “it didn’t work”. Beyond the standard ‘update the driver’ approach, contacting the printer manufacturer for support would be your best bet. They’ll want to know exactly what else might be going on with this printer while the call failed. Including the printer state and whether anybody is tinkering with the printer properties.

    If this exception repeats well then catching the exception is a possible hack. It happens very early, before anything is done with the printer. Sleep for a couple of seconds and try again. Don’t retry forever.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure what is happening with this app. It worked fine then one
Not sure this is a programming question, but we use LaTeX for all our
Not sure this is possible, but looking to write a script that would return
I'm not sure this is possible, but in ruby, you can dynamically call a
I'm not sure this is possible, but is there a syntax to be used
I'm still not sure this is the correct way to go about this, maybe
I am pretty sure this is possible just not sure what is the term
I'm sure this is a fairly trivial problem, but I'm not sure what to
First of all I'm not sure this is even possible, however I need to
Ok I'm working on getting better with python, so I'm not sure this is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.