Results 1 to 32 of 32

Thread: Is there a way to print faster ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Is there a way to print faster ?

    I use a vb6 program to create documents and send them to a line printer.

    For say 50 documents schematically I do this:

    for i% = 1 to 50
    create doc
    print doc
    next i%

    Suppose I do this instead:

    for i% = 1 to 50
    create doc
    bigdoc = bigdoc + doc + page feed
    next i%
    print bigdoc

    will that make it faster ?

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Is there a way to print faster ?

    Hard to say since we have no idea what create doc or print doc actually does.

    I would suspect however that the bottle neck is the printer. Line printers are pretty slow compared to say a good laser printer. The pc should be way faster than the printer so unless there is something in the way you are creating the doc that really slows it down a lot I would not expect to see any increase without switching to a faster printer.

    If you have a laser printer available you could try doing a test print to it and see what kind of speed difference there is.
    Or you could set the print driver to print to file and see how fast it goes. Assuming of course you are using a print driver.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Re: Is there a way to print faster ?

    Quote Originally Posted by DataMiser View Post
    Hard to say since we have no idea what create doc or print doc actually does.

    I would suspect however that the bottle neck is the printer. Line printers are pretty slow compared to say a good laser printer. The pc should be way faster than the printer so unless there is something in the way you are creating the doc that really slows it down a lot I would not expect to see any increase without switching to a faster printer.

    If you have a laser printer available you could try doing a test print to it and see what kind of speed difference there is.
    Or you could set the print driver to print to file and see how fast it goes. Assuming of course you are using a print driver.
    The print command just prints.
    The "create" code bit just might slow things down.
    I can look this one up, but basically it is something simple. The "create" process takes the document's lines from a disk file and sends them for printing.
    Could however the buffer memory affect things however one way or the other ?
    I guess I just don't want to spend paper.
    How do you print to file from vb6 ?

  4. #4
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: Is there a way to print faster ?

    >...line printer
    Is that a special type of printer or just a normal printer. What is the printer model and how is it connected to the pc?

    'normal' printers/ drivers typically send their output to a print cache and so the physical speed of the printer does not affect the time it takes for an application to get its printing operation done (providing you have sufficient memory/ RAM to support the print cache.)

  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Is there a way to print faster ?

    A line printer is typically a large dot matrix printer that uses continuous fan fold multi-part paper. Faster than a typical Dot Matrix printer but much slower than a Laser printer.

    To print to file you can simply alter the properties on your print driver and tell it to print to file rather than LPT1 or whatever address the printer is using. Again assuming that you are using a print driver.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Re: Is there a way to print faster ?

    Quote Originally Posted by DataMiser View Post
    A line printer is typically a large dot matrix printer that uses continuous fan fold multi-part paper. Faster than a typical Dot Matrix printer but much slower than a Laser printer.

    To print to file you can simply alter the properties on your print driver and tell it to print to file rather than LPT1 or whatever address the printer is using. Again assuming that you are using a print driver.
    It's HP D5560.

  7. #7
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,937

    Re: Is there a way to print faster ?

    Wow, this thread seems to already be going off in many different directions, and there's only 3 posts.

    Line Printer. Are we really talking about a line printer, or are we really talking about a dot-matrix printer (or possibly some kind of ink-jet printer). I think we're pretty much gone past the days of true line printers, but they were/are quite fast. They have bars that jump to the correct letter for each of up to 80 (or more) letters per line, and then print/stamp the entire line. Is this what we're talking about?

    Johny, you state that your "create doc" "takes the document's lines from a disk file and sends them for printing". What document are we talking about? Is this an ASCII/ANSI document? Is it Unicode? Is it a file created by VB6? Is it some other kind of document like possibly a PDF, or DOC, or DOCX, or RTF file?

    You've asked, "How do you print to file from vb6?" I thought you said that the documents were already files. Why do you need them printed as files? Do you mean printed in whatever ascii or binary stream as it would go to the printer? To do that, just create a print driver that sends its output to the file and then use it when printing from VB6. But it's far from clear as to what you're actually asking.

    "bigdoc = bigdoc + doc + page feed". Sure, there are many ways to concatenate files. However, first, we've got to know what kinds of files we're talking about. ASCII/ANSI files (and even Unicode files) are rather trivial to concatenate. Other types of files would be a bit more work, but certainly doable.

    Is this really a speed issue that you're dealing with, or is the primary question related to something else? I do think we need a bit more specificity and a bit more focus.

    Regards,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  8. #8
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: Is there a way to print faster ?

    What is the Windows OS and how much RAM is installed?
    Is the printer connected by USB or WiFi?
    A you using the correct and most up to date printer driver?

  9. #9
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,937

    Re: Is there a way to print faster ?

    Ahhh, you posted while I was typing. That's a Deskjet/Inkjet, not really a line printer.

    According to its specifications (found here), it can print: Black text on plain paper, Up to 28 ppm.

    Are you not getting those speeds? If you are and want faster, you need a new printer.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Re: Is there a way to print faster ?

    I think method b, concatenation, may help.
    They 're preprinted forms really.
    I think the printer has to make some jumps between lines so it's not all the stuff made into a string in advance.
    I 'll have to look at it I suppose.

  11. #11
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Is there a way to print faster ?

    Is there any chance the actual issue here is print spooling?

    Aside from that "delay" there are only a few things to consider like the volume of data being printed, the available network bandwidth, and the speed of the printer itself. If you are doing something absurd like rendering "pages" to giant bitmaps and printing those you've already shot yourself in the head and there isn't a lot to be done about it.

    So without knowing a lot more about your situation I'm not sure how anyone will be able to help unless a lucky guess stumbles upon your bottleneck.

  12. #12
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Is there a way to print faster ?

    Quote Originally Posted by Elroy View Post
    Ahhh, you posted while I was typing. That's a Deskjet/Inkjet, not really a line printer.

    According to its specifications (found here), it can print: Black text on plain paper, Up to 28 ppm.

    Are you not getting those speeds? If you are and want faster, you need a new printer.
    That up to 28 ppm is deceiving though. I'm not sure how they come up with those numbers but the ones I have saw in the past only reach the stated number of ppm if you have very little text on the page. every character makes it take a little longer unlike a laser which prints pages at a given rate no matter if it has 1 character or is a full page of text or even an image.

    As for line printer speeds. It has been a long time since I used one and when compared to a conventional dot matrix they are fast but compared to a laser they were a bit slow and very noisy. Depending on the printer they can range from 300 to 3,000 lines per minute where as a laser would be 30-200 pages per minute depending on the printer and could have over 50 lines per page depending on the font size so you would be looking at 1,500 - 10,000 lines per minute. Older cheap ones would be a bit slower.
    Last edited by DataMiser; Feb 13th, 2017 at 04:06 PM.

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Re: Is there a way to print faster ?

    I said line printer, it's USB printer really and I don't have it right here but I have access to it.
    I must look into the piece of code closely.
    From this conversation what I have gathered so far is that I should make the entire stuff to be printed into a single macrocommand and also concatenate 5-10 sheets at a time.

  14. #14
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,905

    Re: Is there a way to print faster ?

    What are you printing, text or images?

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Re: Is there a way to print faster ?

    Quote Originally Posted by Arnoutdv View Post
    What are you printing, text or images?
    Dots on a pre-printed form.

  16. #16
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,905

    Re: Is there a way to print faster ?

    Can you post a sample?

  17. #17
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Is there a way to print faster ?

    Quote Originally Posted by johnywalker View Post
    I use a vb6 program to create documents and send them to a line printer.

    For say 50 documents schematically I do this:

    for i% = 1 to 50
    create doc
    print doc
    next i%

    Suppose I do this instead:

    for i% = 1 to 50
    create doc
    bigdoc = bigdoc + doc + page feed
    next i%
    print bigdoc

    will that make it faster ?
    Unless you have some kind of a reason to use the first method - which is closing the document at each PAGE and having the printer handle that single page document - then avoid it at all means.

    Printers and the drivers associated with them are used to page breaks - sending a multi page document is standard in the industry (has been forever!).

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  18. #18

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Re: Is there a way to print faster ?

    Well here is my print routine:

    u$ = symbol$
    Printer.Font = "Arial"
    Printer.FontItalic = False
    Printer.FontUnderline = False
    Printer.FontBold = False
    Printer.FontSize = 22
    y% = yv%
    For i% = 1 To 54
    X% = xv%
    For j% = 1 To Len(ekt$(i%))
    Printer.CurrentX = X%
    Printer.CurrentY = y%
    If Mid$(ekt$(i%), j%, 1) = "X" Then Printer.Print symbol$
    X% = X% + 358
    Next j%
    y% = y% + 238
    Next i%
    Printer.FontSize = 9
    X% = xv% + 5370
    Printer.CurrentX = X%
    Printer.CurrentY = y%
    u$ = LTrim$(Str$(mydelt!)) + "/" + LTrim$(Str$(alldelt!))
    Printer.Print u$

    Printer.EndDoc


    The parameter symbol$ is the symbol I use for the dot (it's the "*" symbol actually).
    The values xv%, yv% are left margin and top margin respectively (set by me as 90 and 630 in my printer).
    There are 54 lines in each form and the array ekt$() contains the dots to be printed on each line. It's 27 positions per line and some are to be blacked some are to be left, not the same every time. Another routine does that, fill the array ekt$() as is appropriate in each case.

    mydelt! is the form's serial number in the batch
    alldelt! is the total number of forms in the batch
    Those last two numbers are printed at the bottom of the page (page no/ out of pages).

    How to make this into a single string ?
    If I do that then I can add ten-twenty to concatenate.

    So the objective is to write in the end something like:

    printer.print all$
    printer.EndDoc

    How to write the X-Y increments and the font sizes ?
    Maybe there is a reference provided by Hewlette Packard, but again will it be the same for all printers ?

    It's been many years since I was making use of chr$() sequences to control a printer (Ms DOS years). Also those sequences were not the same for every printer.

  19. #19
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Is there a way to print faster ?

    You could do printing in a loop, just do not send the enddoc until you are done and want it to go to the printer.

  20. #20

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Re: Is there a way to print faster ?

    Quote Originally Posted by DataMiser View Post
    You could do printing in a loop, just do not send the enddoc until you are done and want it to go to the printer.
    You say I could keep this routine as is and just make it send ten forms before saying end doc ? Will this eject the form and pull new one everytime and also make it faster ?

  21. #21
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Is there a way to print faster ?

    I do not know about the speed as I have not tested but when you send the end doc that is the trigger that actually starts the printing. If you for example print a bunch of stuff without enddoc and then go about doing something else then nothing prints until you either send an enddoc or exit your program.

    In the case above what you would probably need to do is add a printer.newpage statement where you now have the end doc then put enddoc after your loop.

    As I said I have not tested for speed but I would think that would be faster as it is only sending one print job rather than 50

  22. #22

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Re: Is there a way to print faster ?

    Quote Originally Posted by DataMiser View Post
    I do not know about the speed as I have not tested but when you send the end doc that is the trigger that actually starts the printing. If you for example print a bunch of stuff without enddoc and then go about doing something else then nothing prints until you either send an enddoc or exit your program.

    In the case above what you would probably need to do is add a printer.newpage statement where you now have the end doc then put enddoc after your loop.

    As I said I have not tested for speed but I would think that would be faster as it is only sending one print job rather than 50
    Thanks for that.
    So I don't have to write it like chr$(), chr$() etc.
    I 'll give it a try.
    I cannot print all those stacks of paper but when the one who prints reports to me I will tell you what happened.

  23. #23
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Is there a way to print faster ?

    You generally will not mix the use of a Printer object with CHR$() escape sequences.

    The print driver that the Printer object uses knows all about the CHR$() escape sequences for that printer and that is what it uses in the background.

    Printer.NewPage will do what you need for ejecting the page.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  24. #24
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: Is there a way to print faster ?

    In order for a print job to start emerging from the printer Printer.EndDoc must be executed, until then the print job is only spooled into the print queue. So it is most likely quicker to use EndDoc at the end of each page because the physical printing will start sooner. If Printer.NewPage is used the print job will not start emerging until the 50th page (ending with EndDoc) has been sent.
    The print job is likely to spool faster (and unfreeze the application faster) if you used NewPage between each page because only one print job would need to be queued but physical print completion would take longer (reference the time when you clicked the print button) because it would take longer to begin.
    To make the printer print as fast as possible attend to its quality settings and set the minimum (typically 'draft')

  25. #25
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Is there a way to print faster ?

    It is truly a terrible idea to END DOC between pages.

    Other print jobs can get inserted.

    I've never in my life thought to do something like this.

    Be very careful...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  26. #26
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Is there a way to print faster ?

    Quote Originally Posted by Magic Ink View Post
    In order for a print job to start emerging from the printer Printer.EndDoc must be executed, until then the print job is only spooled into the print queue.
    My printer has options to print pages before the End Doc.
    Attached Images Attached Images  

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  27. #27
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: Is there a way to print faster ?

    >My printer has options to print pages before the End Doc
    Have those options set here too but no printing happens for me before an End Doc.

  28. #28

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Re: Is there a way to print faster ?

    I mean to try this:

    Instead of

    do
    print doc
    enddoc
    if end of batch exit loop
    loop

    do it like

    do
    print doc
    new page feed
    counter = counter + 1
    if counter = 50 or end of batch then end doc:exit loop
    loop

  29. #29
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Is there a way to print faster ?

    A For Next would make more sense

    Code:
    For X = 1 to 50
       Print doc
       New Page
    Next
    
    End Doc

  30. #30

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Re: Is there a way to print faster ?

    Quote Originally Posted by DataMiser View Post
    A For Next would make more sense

    Code:
    For X = 1 to 50
       Print doc
       New Page
    Next
    
    End Doc
    ok, those are details

  31. #31

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    231

    Re: Is there a way to print faster ?

    Thanks.
    I did like you said here and now it's faster (it took some time the guys who do the printing to get back to me).

  32. #32
    Member
    Join Date
    Apr 2010
    Posts
    45

    Re: Is there a way to print faster ?

    Quote Originally Posted by johnywalker View Post
    Thanks.
    I did like you said here and now it's faster (it took some time the guys who do the printing to get back to me).
    I found something that works well for me. I automate word, create a new document, then in a loop, create a doc in a rich textbox in the vb6 program, dump the entire richtextbox content into the word doc in one line, add a page break, repeat until the word doc is populated, then print the entire word document, there's only one print command. I don't know if that's of any use to you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width