• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1377
  • Last Modified:

Printer capture from a MSDOS Clipper 5.2 application

Clipper 5.2, MS-DOS, Windows 7 32bit development machine.

I don't even know where zone will I be posting this question, but here it is.

I have the need of modifying a 25 year old application because of a couple of fields that grew up more than what we would expect.... you can't blame, it is 25 years.

Well, the thing is this software has a lot of reporting. I have this "epson" codes all over the place, and now I have the need to test all the reports because due the new widths on a couple of fields, it is very likely it will not fit the 80 characters in their matrix printer.

So, I'm looking for a software that allows me to capture the output from this DOS application so I can see that everything is ok.

Of course borrowing a printer and a bunch of paper would work as well, but I'm environment conscious. :)

Any recommendation is very welcome.
0
fischermx
Asked:
fischermx
  • 6
  • 5
  • 3
  • +3
1 Solution
 
Delphineous SilverwingGood Ol' GeekCommented:
Are you running this DOS program from within Windows?  If so, Snagit might work for you ( http://www.techsmith.com/snagit/ ).
0
 
fischermxAuthor Commented:
Yes, in my development machine I use Windows 7.

The users also has Windows 7 and they use it in a small windows, they print fine in their matrix printer, it is just that I don't have one.

That snagit sounds like a fun software, but I think I remember there use to be free options.
The only I found now is "printfil.com" but it's not free, and since I'm doing this as a sort of favor, I would like to find a free option.

0
 
Steve KnightIT ConsultancyCommented:
Can you not just set a new printer up using FX80 driver or whatever and set it to print to file in the ports tab.  Then you end up with a file + Epson code of course.

You could filter those out if needed with a bit of manual or automated search and replacing, though would have to be specific as there is no real pattern to them.

Steve
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
Steve KnightIT ConsultancyCommented:
Hmm I wondered if DosBox (http://www.dosbox.com) would have a solutiion too and it looks someone in their forum below has written a gadget for it that emulates and Epson FX type codes and dumps it out as an image... any good?

http://vogons.zetafleet.com/viewtopic.php?t=4281

Steve

0
 
printnix63Commented:
Hi, if the width is just counting 80 chars, and the application probably only prints to LPT1, you can
install a windows printer, share it and then use
net use lpt1: \\computer\printershare
You set the shared printer onto port file.
When you now print, it should redirect this to the shared printer which will let a requestor come up to enter a file name.
You can then open up the prn file in e.g notepad++ or notepad and check if the chars are fine.
0
 
fischermxAuthor Commented:
I'm trying your suggestion of adding a FX80 printer.
I did what you do, but my program fails with a "Printer not ready" error.

I think I need to do something from DOS to capture it.
0
 
fischermxAuthor Commented:
printnix63, I was trying to do exactly that, but didn't know I had to set it as "shared".

Now I did it and I don't get the error, the program acts like if it print it, but it does nothing.

I would expect to get a prompt asking a filename to save the output as a file, but the document just keeps there in the printer queue.
0
 
Steve KnightIT ConsultancyCommented:
BTW can you amend the port the dos program prints to at all?  It was quite common once for this just to be a text field where "LPT1:" or "LPT2:" etc. was typed in and it was accessed as a file from within the application.

We actually used to print to a printer port of "c:\spool" in those days and then had batch routine to take that output to real printer, so print jobs did not need re-running.

Steve
0
 
rinfoCommented:
This is one of the tricks  that sometime does works.
Share enable your windows printer and assigned it a name within 9 chars.
Then use following command in dos prompt.

NET USE LPT1 \\[yourcomputername)\[your share enable printer name] / persistent:yes
Now all LPT1  redirection will go through your windows printer.

0
 
rinfoCommented:
Sorry shared printer name should be within 8 chars and not 9 chars
0
 
fischermxAuthor Commented:
Yes, I'm doing that, I shared the printer and captured the port with net use.
I setup the port to "File".

Now, I print from the DOS program and it runs fine, and in the driver window I can see the document in queue, but I never get the dialog to give a file name to save.

0
 
rinfoCommented:
Do you wants to export the print-to-be document to some format - text,csv or pdf.
I think this will be beffer handled using clipper code.Say there you have the provision/option to save to file or print. Besides i do not think you can save in amy format except text file.I do not think there is anything called printdialog in clipper unless you explicitly code one and use that in your application.
0
 
printnix63Commented:
Hi, could you check, if the printer is "paused" ?
If this printer had been a network printer before, it might have had SNMP on, and when set to file, it does not receive any response, so windows might set it to offline/paused mode.
I'd definitly would expect that the printer object would pop up a window - on the other hand, .... when the file hangs in the spooler you could eventually open it from the print$ directory.
(mostly: C:\Windows\system32\spool\drivers)
0
 
fischermxAuthor Commented:
Trying to isolate the problem, I tested the fake FX80 printer, without using the clipper program, i.e. trying the Test Page

Well, I have both PDFCreator and PDFFill and non of this can get the page out of the printer. They fail in some way or another.
Sending to "One Note" does not work either.

The print to File does work, it prompts for a file name (which does not do when I print from clipper program), I provide a path and file, and a file is saved, though I don't know what does that file contain.

0
 
printnix63Commented:
If it has %PDF at the beginning it is a pdf document,
if it has loads of binary it is probably PCL (could be something else, but in must cases it is so)
if it is plain ascii except for some ESC sequenzes, like ESC P ( 1b 50 as Hex Code)
then it is Epson Emulation
0
 
Steve KnightIT ConsultancyCommented:
OK have just tried this with an old DOS app.

Create new printer "generic / text only"
Share it as "text"
Add a local port called D:\spool.txt ... or some other location you can write to
Optionally tick the box in the printer saying "hold printed documents" - then you can reprint docs etc.

Don't set the port to LPT1.... as I did originally and the spool directory got bigger and bigger.... the captured job then tried to go to LPT1, which was captured back to this printer....

In command prompt:

net use lpt1: \\%computername%\text
e.g.
dir > lpt1:

should give you a file in d:\ called spool.txt

See if that works first to prove it gets to Windows.  Then try from your Clipper app.

Always possible it goes directly to the LPT1: ports rather than asking the OS for it which may be an issue in command prompt in Windows.

Steve Printer Q Printer 2 Printer3 Printer4
0
 
pgs2Commented:
if you have access to the program code, change printer to output to file:

set printer to c:\filename        && INSTEAD OF SET PRINTER TO LPT1
print whatever you want
set printer to                          && close output to printer


exit clipper app and open file for inspection
0
 
fischermxAuthor Commented:
Thank you!
0
 
Steve KnightIT ConsultancyCommented:
for future reference which way (if any) worked in the end?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
  • 3
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now