We help IT Professionals succeed at work.

DOS Application Printing issues

Tim Palmer
Tim Palmer asked
on
Medium Priority
549 Views
Last Modified: 2012-06-22
Hello experts,

this has been doing my head in for a while but heres what i've got

Terminal services client running some old DOS based applications which can only print to LPT1.
I have a generic/text only printer which is mapped as LPT1 and using PRN2FILE.COM to redirect the output to a text file.

however the output is too wide for one page.
What i need is to be able to modify the output font somehow to be either narrower or smaller so it cna fit wide

the output is a text based table and if its not on one line per record it looks completely wrong

I've tried shrinking the text to 8pt and making the page landscape but its still stupid.

it used to work when it had a physical printer connected to it however the issue is now it doesn't but a soft-copy is required.

Please let me know if you need more information
@echo off
:program path
net use f: \\sydsvr03\public\warranty\shared\wr
:printer output
c:\prn2file.com f:\printo~1\op-%random%.rtf /P1
f:
wr.exe
net use f: /delete

Open in new window

Comment
Watch Question

CERTIFIED EXPERT

Commented:
What do you mean by generic/text only printer , is it dot-matrix printer, or line printer, pl.explain col.size supported by your printer on which you are printer this text file and also width/max.col size of your file which you want to print.
Pl.let me know does your printer support condensed mode printer, generally all dot-matrix printer support this. If your printer on another laser/deskjet printer pl.provide the paper size your printer support so that i can find out any proper sol.for you.

Think if there is a problem there must be a solution and i.s. IT.
Best of luck.

Bm Keshav
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
How wide is it trying to print.  I understand what you are trying to do, but unless it was designed to print to wide paper an A4 printer certainly would only have had maybe 160 characters wide.  In notepad on my 22" monitor at 8pt Courier new I can get 220 characters wide... I say courier because I assume the output will be line up so needs to be a fixed pitch one.

Are you jsut trying to read this on the screen, or to print it out again afterwards?  I wonder if changing the paper size to A3 in the generic print driver (advanced buton under pritner preferences) might give you enough cpl?

Can you post a sample text file of what it is producing at all?
Steve
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
What I am getting at is the printer driver may be wrapping the text at the end of it's A4 lines...
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
Hmm, I've just sent a 250 character wide text file to lpt1: mapped to a generic printer printing to file.... and the text file that came out of the generic printer is exactly the same as the text I sent with no wrapping etc... and that was with it set to A4.

That was just by sharing the generic text printer and then net use lpt1: \\pcname\genericshare mind not with con2print
Tim PalmerLevel 3 Support Technician

Author

Commented:
@BMKESHAV
Generic/Text only is a printer driver in Windows that allows you to print to a file. It is not a physical printer

@dragon

unfortuately I'm not allowed to post a sample of the text file as its confidential company information.

on our old system it used to print on A4 and be very squished, like a narrow font?
the output needs to go into a document (most likely printed) to go to the top boss in the company.
The old printer was just a standard Canon printer but it was in place for so long the guy who set it up is long gone and forgotten so I can't even draw on him.

when I try mapping lpt1 to a shared generic/text only printer the application tells me that the printer isn't ready
CERTIFIED EXPERT

Commented:
@Phreakwently :
If your output is being sent to file first and col.width is >A4 size, then there is two methods to get proper printout :
1) Arrange a Dot-Matrix Printer of 132 Col. (B/c these type of text files is being desigend for these printers)
or
2) Modify (Change the font size of your text file/adjust col. manually in any word processr/spread sheet, its depends on format of your file)

As i think option 1) is permanent solution.

Bm keshav
Tim PalmerLevel 3 Support Technician

Author

Commented:
for point 1, do you mean a physical printer? if so, thats out of the question

if not, how do you propose i configure my printers for that?
CERTIFIED EXPERT

Commented:
Yes, Physical printer.
If you are unable to procure a printer try to do as advised in option 2.
B/c u are not showing your text file ( how can i guess the format of the text file) and until i don't know the format i am unable to provide you any solution. If you cann't put your original text file, put a sample/dummy with exact format.

Bm keshav



Tim PalmerLevel 3 Support Technician

Author

Commented:
well the output is text and putting a sample up isn't an option since its confidential output.

The output at the moment is an RTF using PRN2FILE and using a shared generic/text printer isn't working
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
If you can't supply us with information to look at it is difficult to help you unless you are prepared to look at the files yourself.  What I am trying to identify is in the file whether it already has carriage return/line feeds in at a certain point across in the output for instance or whether there are other codes in there.

I'm sure it wouldn't take much to take half a dozen lines of the output in Notepad and remove anything incrimentating and post.  My email address is in my profile (click dragon-it link above) if you prefer to send direct rather than post publically... I assure you would not go anywhere dodgy!

For A4 landscape laser output if the app was designed for that (and I was doing so from DOS apps around 18 years ago... you could get 132 or160 characters across depending upon the mode chosen. Some printers could do, I think, 220.  This was sending raw text to the printers though and I imagine what is happening here is you are capturing the data using the generic printer and then opening it in a windows app and using that to print?  

Once you have the raw text file it would be perfectly possible to load it into Notepad and ajust printer settings there or just add PCL codes, say, to control a printer to put into Landscape small fonts mode etc. if you did want to print.  Without seeing the output you are getting or knowing what you are viewing this in it is a trifle difficult.

Another possible option is to use pdfcreator.  You can setup pdfcreator on a pc (it is possible to put it on a server as a service but for this purpose on a normal PC), share it and therefore connect lpt1: to it as you are at the moment.  You can configure that to AutoSave as PDF or one of many other fonts.

Where are you in the world btw?

Steve
Tim PalmerLevel 3 Support Technician

Author

Commented:
I'm in Sydney.

email sent to you dragon.

I had tried mapping cutepdf to lpt1 but that was a failure.
Is PDFcreator the name of the application you're suggesting?
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
yes that is a free app that will produce pdf or various other fomats from print output.  Have got your email and will look later...
IT Consultancy
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Tim PalmerLevel 3 Support Technician

Author

Commented:
Yeah i'll definately give that a try at work tomorrow - will let you know
Tim PalmerLevel 3 Support Technician

Author

Commented:
Got me on a line of thought

Process I ended up doing is:
copying the paste from notepad to Word 2007
changing the font to 6pt Courier New (not 100% accurate but acceptable)
changing the margins to narrow
and changing the paragraph spacing

passes muster in a word document which means it can be put into a report easily for its ultimate PDF destination.

Thanks for your assistance
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.