hbwin / win_prn delay when printing on network

342 views
Skip to first unread message

Karl

unread,
Jun 3, 2012, 1:12:40 PM6/3/12
to harbou...@googlegroups.com
Dear All,

I am using win_prn to print in my applications.  It works fine and is very fast when invoked on the (print) server itself.  When I call the ::win_prn:endDoc(lAbortDoc) on a client it takes aprox. 5-10 seconds before it prints.  This is not really feasible for my customers.  

Please note that it is NOT a network problem or a printer setup problem since it prints very quickly on the clients using other programms or lpr in a dos box.

Environment: Server: Windows server 2008 / 64 bit (print server and application server) 
                      Clients: Windows 7 64 bits

The program is installed on the server and is started from a network drive mounted on the clients.  So it may be a library loading issue?  Even though printing does not get faster if issued multiple times.

Any idea would be very much appreciated.

Thank you very much
 Karl

Abe Buchinger

unread,
Jun 3, 2012, 2:10:08 PM6/3/12
to harbou...@googlegroups.com
try putting inkey(2) after enddoc. i'm having a similar issue. report back please.


On Sun, Jun 3, 2012 at 1:12 PM, Karl <jo4...@googlemail.com> wrote:
Dear All,

I am using win_prn to print in my applications.  It works fine and is very fast when invoked on the (print) server itself.  When I call the ::win_prn:endDoc(lAbortDoc) on a client it takes aprox. 5-10 seconds before it prints.  This is not really feasible for my customers.  

Please note that it is NOT a network problem or a printer setup problem since it prints very quickly on the clients using other programms or lpr in a dos box.

Environment: Server: Windows server 2008 / 64 bit (print server and applicatiotrn server) 
                      Clients: Windows 7 64 bits

The program is installed on the server and is started from a network drive mounted on the clients.  So it may be a library loading issue?  Even though printing does not get faster if issued multiple times.

Any idea would be very much appreciated.

Thank you very much
 Karl

--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users



Karl

unread,
Jun 4, 2012, 6:29:47 AM6/4/12
to harbou...@googlegroups.com
Finally I managed to reproduce the problem at home, so now I can provide more debug details.  The delay is not as I first thought in the endoc() method but in new() and create().

Here is the performance table when invoked on the client (now on a windows xp / 32bit):

Methods invoked in ....\hbwin\win_tprn.prg 

new:            3.34 sec                              
   entire delay in win_GetDocumentProperties (line 444)

create:        4.89 sec                           
   destroy:                                  0.00 sec                       
   win_createDC:                        3.95 sec        (line 228)    
   win_setDocumentProperties:  0.92 sec                   

startDoc:        0.81 sec                         

endDoc:         0.25 sec                           

Here is the performance table when invoked locally on the file and print server (now windows 7 / 32bit):

Methods invoked in ....\hbwin\win_tprn.prg 

new:            0.03 sec                              
create:        0.11 sec                           
   destroy:                                  0.00 sec                       
   win_createDC:                        0.05 sec                    
   win_setDocumentProperties:  0.05 sec                   
startDoc:        0.36 sec                         
endDoc:         0.14 sec       

The parameter printername is something like \\192.168.2.2\HP.

@Eager: thank you for your feedback.  Where shall I put the inkey(2) now?

Best regards
 Karl                    

Karl

unread,
Jun 4, 2012, 11:50:41 AM6/4/12
to harbou...@googlegroups.com
If I install the network printer (192.168.2.131) directly on the client, printing is fast again.

So accessing the Printer/Queue HP locally using win_prn:new("HP") is fine.  When accessing it installed on another server win_prn:new("\\192.168.2.2\HP") it is slow.

Of course I could install the printer on all clients, but if possible I want to avoid that.

Best Regards
 Karl

Massimo Belgrano

unread,
Jun 4, 2012, 12:37:38 PM6/4/12
to harbou...@googlegroups.com
In my opinion is good Solution install the printer on all clients 


2012/6/4 Karl <jo4...@googlemail.com>
 Karl

-- 

--
Massimo Belgrano


Karl

unread,
Jun 4, 2012, 12:54:47 PM6/4/12
to harbou...@googlegroups.com
Dear Massimo,

this is okay for this current customer as they only have 3 clients.  Nevertheless I have customers with 20+ clients.  So it would be a lot of additional work for installing and maintainig all printers locally.

BR
 Jochen

Massimo Belgrano

unread,
Jun 4, 2012, 1:41:25 PM6/4/12
to harbou...@googlegroups.com
I have customer also with 100+ pc
and have alwasy installed the printer
need for word

2012/6/4 Karl <jo4...@googlemail.com>
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users



--
Massimo Belgrano

Delta Informatica S.r.l. (http://www.deltain.it/) (+39 0321 455962)
Analisi e sviluppo software per Lan e Web -  Consulenza informatica - Formazione

Karl

unread,
Jun 5, 2012, 6:34:05 AM6/5/12
to harbou...@googlegroups.com
I solved it :)

Don't ask me why but the clue is to use the host-name instead of the IP address.  It does not seem logical to me but here are the results (repeatable on my setup):

192.168.2.2\HP

new:          6.22 sec               
create:      10.14 sec            
startDoc:     1.88 sec          
endDoc:       0.73 sec

myserver\HP

new:          0.17 sec          
create:       0.66 sec       
startDoc:     1.55 sec     
endDoc:       0.39 sec

Another developer proposed to me to change the lpt_timeout in the registry.  Even though this seemed a reasonable approach to me it does not have any effect.

Anyways thanks a lot to everybody for your support.
 Karl

Ulisses

unread,
Jun 4, 2012, 11:25:30 AM6/4/12
to harbou...@googlegroups.com
Karl,

I had a problem like yours some time ago. It was a windows printer
problem and it was imposed by software instalation. My Windows vas a
XP-PRO/32 but I believe your 7/64 may suffer the same ill. It�s a delay
windows uses to see if no more printing will occur in order to release
your document to the printer.

What I did was to go to REGEDIT and execute a locate for LPT_timeout. If
I find a value of 15 (seconds, the usual at instalation time) change it
to 1 (I don�t remember why, but do not use zero). The LPT_timeout
appears there several times, so I had to repeat the locate until all
values were set to 1.

This solved my problem. I expect yours to be solved also.


Ulisses Bruder Jr
---------------------

Em 03/06/12 14:12, Karl escreveu:
> Dear All,
>
> I am using win_prn to print in my applications. It works fine and is
> very fast when invoked on the (print) server itself. When I call the
> ::win_prn:endDoc(lAbortDoc) on a client it takes aprox. 5-10 seconds
> before it prints. This is not really feasible for my customers.
>
> Please note that it is *NOT* a network problem or a printer setup
> problem since it prints very quickly on the clients using other
> programms or lpr in a dos box.
>
> Environment: Server: Windows server 2008 / 64 bit (print server and
> application server)
> Clients: Windows 7 64 bits
>
> The program is installed on the server and is started from a network
> drive mounted on the clients. So it may be a library loading issue? Even
> though printing does not get faster if issued multiple times.
>
> Any idea would be very much appreciated.
>
> Thank you very much
> Karl
>

Hugo Gabriel

unread,
Mar 2, 2014, 9:13:52 PM3/2/14
to harbou...@googlegroups.com
Hi Karl

I starting to work with a Thermal label Printer, with a ethernet connection. In the manual says ethernet serial.
The project is almost done, I´m a product data from a db, and linking with form design, and printer setting.
I'm looking for help in a few things, few but more than important, because my project depends on it.
There's no drivers for this printer, and I do not want to send only a label to print, I need to get control on the printer. Anyway, Windows is not getting the printer by it self, it can not find it, if I install it via standard TCP/IP port, it just says "ready".
Well, by internet navigator I can access the internal application of the printer, with the ip 10.0.0.15, so the connection is working. With a small app, developed by the manufacturer, I can access and see the internal folders, system files, logs, etc.
I have the commands protocol, but i also need to read the data coming on response after I send a command request for data. Like ~DR|, which is asking for printer status.
It is a very expensive printer, and I getting access to it by remote desktop, because we are not in the same country.

What I need to send the commands and receive the answers from the printer, 
- I read and learn all about Sockets, TCP/IP and more' but I do not want to process with tests with out at least a guide..
- I also have a serial port that I can use, but I do not know if I change the connection to it, it will need an other port protocol.

I hope you can help me.

Thank you
Reply all
Reply to author
Forward
0 new messages