Solved

DOS Application Printing issues

Posted on 2009-07-01
15
513 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

0
Comment
Question by:Tim Palmer
  • 6
  • 6
  • 3
15 Comments
 
LVL 6

Expert Comment

by:BALMUKUND KESHAV
Comment Utility
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
0
 
LVL 43

Expert Comment

by:Steve Knight
Comment Utility
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
0
 
LVL 43

Expert Comment

by:Steve Knight
Comment Utility
What I am getting at is the printer driver may be wrapping the text at the end of it's A4 lines...
0
 
LVL 43

Expert Comment

by:Steve Knight
Comment Utility
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
0
 
LVL 3

Author Comment

by:Tim Palmer
Comment Utility
@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
0
 
LVL 6

Expert Comment

by:BALMUKUND KESHAV
Comment Utility
@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
0
 
LVL 3

Author Comment

by:Tim Palmer
Comment Utility
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?
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 6

Expert Comment

by:BALMUKUND KESHAV
Comment Utility
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



0
 
LVL 3

Author Comment

by:Tim Palmer
Comment Utility
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
0
 
LVL 43

Expert Comment

by:Steve Knight
Comment Utility
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
0
 
LVL 3

Author Comment

by:Tim Palmer
Comment Utility
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?
0
 
LVL 43

Expert Comment

by:Steve Knight
Comment Utility
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...
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
Comment Utility
Tim,

Those look fine to me... only problem is they are called RTF so if opened in Word by default they end up looking rubbish.  Just changed the extension to .TXT and opened in Notepad.  make sure word wrap is turned off (format | word wrap) and change the font to something smaller (format | font).  The "Terminal" font is good for this being a nice small font tha is still readable at 6pt for example.

With that shows fine though need to scroll right a little still to see on my 15" 1024x768 laptop screen, should fit fine on a 1280x1024 bigger monitor...

I don't THINK i'm missing something else, give it a try?
0
 
LVL 3

Author Comment

by:Tim Palmer
Comment Utility
Yeah i'll definately give that a try at work tomorrow - will let you know
0
 
LVL 3

Author Closing Comment

by:Tim Palmer
Comment Utility
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
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now