We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Multithreaded html printing

Thread ID:

Created:

Updated:

Platform:

Replies:

117179 Aug 28,2014 06:30 AM Sep 2,2014 08:42 AM Windows Forms 2
loading
Tags: HTMLUIControl
Dmitriy ett
Asked On August 28, 2014 06:30 AM

Hello.
I am using your html controls to print html documents in IIS hosted web services. When request is arrived to web service IIS starts its work on new thread.
To reproduce this behavior I created next stub:

    Parallel.For(0, 5,
                i =>
                {
                    var control = new HTMLUIControl();
                    control.LoadFromString("<head></head><body><p>Hello world</p></body>");
                    var printDocument = new HTMLUIPrintDocument(control.Document);
                    printDocument.DocumentName = "Test print";
                    printDocument.PrinterSettings.PrinterName = "Printer name";
                    printDocument.Print();
                });

Basically, what I want to achieve is to add this printings into a queue.
This stub crashes with ArgumentNullException on var printDocument = new HTMLUIPrintDocument(control.Document); because control.Document returns null.

What can I do to fix it?
BTW how can I prevent HTMLUIControl from displaying its contents on screen while it's printing?

Saravanan T [Syncfusion]
Replied On August 29, 2014 12:37 PM

Hi Dmitriy,

 

Thank you for using Syncfusion products,

 

We would like to let you know that we have forwarded your query to our development team for further analysis. We will get back to you with the analyzed details before the end of September 2nd, 2014.

 

Please let us know if you need any further assistance,

 

Regards,

Saravanan T


Saravanan T [Syncfusion]
Replied On September 2, 2014 08:42 AM

Hi Dmitriy,

 

Thank you for your patience,

 

We would like to let you know that we can use the ResetText method to prevent HTMLUIControl from displaying its contents on screen while it's printing. We have prepared a sample for your requirement and it is available in the attachment. Please look into it and let us know whether it meets your requirement.

 

Code Snippet [C#]:

 

this.htmluiControl1.ResetText();

 

Please let us know if you need any further assistance,

 

Regards,

Saravanan T


Attachment: HTMLUIControl_f127657f.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;