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

  • SEARCH
  • Home
  • 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 8321659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:05:42+00:00 2026-06-08T23:05:42+00:00

Is it possible to print in Silverlight without blocking the UI thread? I have

  • 0

Is it possible to print in Silverlight without blocking the UI thread?

I have to print a lot of pages, and consequently my UI freezes for a while. I would like to print on a background thread instead (and update a progress bar if possible), but can’t figure out how.

I tried calling the Print() method of my PrintDocument inside the DoWork() method of a BackgroundWorker, but that gives me an UnauthorizedAccessException "Invalid cross-thread access".

It seems that even initiating a PrintDocument is not possible outside the UI thread:
PrintDocument pd = new PrintDocument(); in BackgroundWorker.DoWork() throws the same exception.

I found a lot of posts where people say that printing has to happen on the UI thread, but no documentation of this. I’m new to multithreading, so any pointers in the right direction would be appreciated.

  • 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-06-08T23:05:44+00:00Added an answer on June 8, 2026 at 11:05 pm

    I had this problem and came across this question which unfortunately didn’t have the answer i was hoping for. But I thought that for anyone else who comes across this problem, this may at least shed some light.

    I was following this article on printing in Silverlight, It works like a charm for regular printing on the UI Thread, but for actually trying to print on a separate thread I don’t think it’s possible. I switched out the last line of code in the example

    printDocument.Print("SLPrintDemo document");
    

    with an alternate one to see if it would work

    new Thread(() => printDocument.Print("SLPrintDemo document")).Start();
    

    To see if the print job itself would spawn in a separate thread. However though the code compiles and runs fine, the document does not print. The reason seems to be that once the Print command is fired, it then fires up the printing options dialog for choosing printer and other options etc. At this point it is no longer on the UI thread so nothing happens ( No exceptions, so i’m assuming they’re swallowed somewhere)

    So as far as I can tell at the moment, there is no way to print in Silverlight that is not in the UI thread.

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

Sidebar

Related Questions

Is it possible to print full list without using cycle? I tried: Console.WriteLine([1;2;3;4;5]) and
I have kind of reports about students accounts is it possible to print it
It is possible to overide rebol system words like print, make etc., so is
Is it possible to print the thread name in the log statements generated by
Wondering if it's possible to print a carriage return without a line feed in
Greetings! I am currently working on a Silverlight project and I would like to
Using Silverlight 4, is it possible to print a grid in landscape mode and
I am using the Telerik ReportViewer and would like to display it in Print
Is it possible to print the page to where the link is directed? I
Is is possible to print the execution time of a shell command with following

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.