Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Internet Printing (ReadyState always 4)
Started by tempt632 at 06-19-2008 10:22. Topic has 3 replies.

Print Search « Previous Thread Next Thread »
  06-19-2008, 10:22
tempt632 is not online. Last active: 6/18/2008 4:13:51 PM tempt632

Top 150 Posts
Joined on 10-16-2006
Posts 16
Internet Printing (ReadyState always 4)
Reply Quote
When trying to print images using the ActiveX control, I keep getting the following error when the Render method is called: "ltocx14n: LEAD Error: Invalid bitmap handle".  If i examine the bitmap property at this point it is zero. However, if i continue past the exception, the image will show up in the lead control.

The code at this point looks like this:
Lead.BitmapDataPath = "image.aspx";
var HDC = Lead.PrintStart();
Lead.Render(HDC, 0, 0, 0, 0); //exception being thrown here
Lead.PrintEnd(HDC);


I have discovered that if i inject something such as an alert dialog, and once the dialog is dismissed, the bitmap property is non-zero and the render method will succeed and execution will continue.

The code after causing a delay:
Lead.BitmapDataPath = "image.aspx";
alert("Let the image finish loading!"); //alert allows the image to finish loading
var HDC = Lead.PrintStart();
Lead.Render(HDC, 0, 0, 0, 0); //exception being thrown here
Lead.PrintEnd(HDC);


I have read the documentation and the documentation indicated that the ReadyState property should be examined to determine if an image is still being loaded or not.  However, the value of the ReadyState is always 4 and cannot be modiifed as it is a read only property.

Is there another method to tell when an image has finished loading or is still in the process of loading?

Using LeadTools 14.5

^^
JAVD
   Report 
  06-20-2008, 18:01
Walter is not online. Last active: 11/13/2008 12:56:37 PM Walter



Top 25 Posts
Joined on 04-14-2008
Charlotte, NC
Posts 112
Re: Internet Printing (ReadyState always 4)
Reply Quote
I'd suggest looking at the ReadyStateChange event if you have not already done so. You'll want to set the BitmapDataPath and then wait for this event to fire. Once the event fires, you can then check to see that the ReadyState is equal to "READYSTATE_COMPLETE". There are examples in the documentation on using this event.
Walter
Technical Support
LEADTOOLS
support@leadtools.com
   Report 
  06-24-2008, 10:36
tempt632 is not online. Last active: 6/18/2008 4:13:51 PM tempt632

Top 150 Posts
Joined on 10-16-2006
Posts 16
Re: Internet Printing (ReadyState always 4)
Reply Quote
Looking through the examples folder, i do not see any use of the ReadyState event or use of the ReadyState property in the context of the ActiveX control

Further, the lead object does not even have a method ( accessing the ActiveX control via javascript) or property representing the ReadyStateChange event.

Could you provide a short example ( or point to a specific example ) of how tap into this event through javascript?

Using LeadTools 14.5

^^
JAVD
   Report 
  06-26-2008, 12:57
Walter is not online. Last active: 11/13/2008 12:56:37 PM Walter



Top 25 Posts
Joined on 04-14-2008
Charlotte, NC
Posts 112
Re: Internet Printing (ReadyState always 4)

Attachment: JS_ReadyStateEvent.zip
Reply Quote
I have attached a short example of how to use the ReadyStateChange event in Javascript.
Walter
Technical Support
LEADTOOLS
support@leadtools.com
   Report 
Post
LEAD Support Fo... » Developer » Internet » Internet Printing (ReadyState always 4)

Powered by Community Server, by Telligent Systems