Announcement

Collapse
No announcement yet.

1 minute printer delay

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 1 minute printer delay

    Hi there.

    I am using LPRINT to print to LPT1: which is actually a shared printer that I have "net use"d. When I send data to the printer, and a final formfeed, there is a one minute delay (exactly, and every time) before the printer (any make or model) starts printing the document. The funny thing is that if I exit my program and then exit the DOS console, the printing happens immediately. I am guessing that the LPT1: redirection is freezing up for a minute inside the DOS console... but I really don't know for sure. Does anyone else know why this happens? Can it be fixed?

    Thanks.

  • #2
    There are a few ways to sort the problem out. Essentially it is because the redirector has no idea when the print data stream is finished, so it times out after approx 45 seconds or more.

    1. The first approach is to explicitly CLOSE the print stream, but you cannot do this with LPRINT. You'll need to change all LPRINT statements to use PRINT #1, etc (after doing an OPEN "LPT1:" FOR OUTPUT AS #1, etc), and explicitly CLOSE the file when your print stream is finished.

    2. Edit the SYSTEM.INI file in Windows to reduce the timeout delay to 10 seconds. I've searched MSDN and I can;t find the right KB article, but it describes the additions/changes. There are two sections to add or change.

    3. Print the entire print job to a disk file, and then SHELL "COPY filename.txt LPT1 > NUL"
    (this works great but if there is a problem you get an untrappable "Abort, Retry, Ignore" message across the screen.

    4. Use a PB/CC application to handle the printing, using a combination of #4 and #1 above, and launched with a SHELL statement. For example, my DOSPRINT utility works this way.

    I hope this helps.



    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      I would highly recommend going straight to Lance's Dosprint.

      The approach of "...change all LPRINT statements to use PRINT #1..." works
      great until you run into one of the new low cost Windows only printers. The
      character handling firmware has been removed and replaced by a software
      driver that only works with Windows graphic interface. Thus, this type of
      printer cannot accept a Dos generated character string.

      Dosprint takes your "character" file and converts it to Window's graphic
      driver interface. Works like a champ!

      Plus Dosprint means you no longer have to be concerned about what type
      of printer you have. I replaced a group of dot matrix, laser jets, deskjet, etc.
      printer setups with just one that fed Dosprint. All my current users are
      using this successfully.

      Dennis Moore



      ------------------

      Comment


      • #4
        Thanks for the praise! A demo version of DOSPRINT V1.01 can be downloaded from www.amerimports.com/dosprint

        Also see my posting in the 3rd-party forum looking for testers for the impending V1.2 release.

        Regards,
        Lance.

        [edited by Administrator to correct the URL]
        Lance
        mailto:[email protected]

        Comment


        • #5
          Lance, I have a copy of the article you are referring to, in fact,
          the post is from 1997 and posted by yourself.
          The Knowledge Base Article ID is # Q140036

          Basically, go in and edit SYSTEM.INI --

          Add the following lines after the [386Enh] section.

          [Network]
          PrintBufTime=10

          [IFSMGR]
          PrintBufTime=10

          The "10" is the number of seconds before printing starts. It
          depends on how busy the network is, but I have mine set for "2"
          on each on and it almost prints instantly. Also make sure
          "Spool MS-DOS jobs" is turned off.

          Hope this helps and Lance thanks again for the original post.
          I was pulling my hair out way back when on this problem.

          Gary Stout
          [email protected]


          ------------------
          Thanks,
          Gary Stout
          gary at sce4u dot com

          Comment

          Working...
          X